summaryrefslogtreecommitdiff
path: root/src/syscall-generic.h
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2018-01-12 13:51:51 -0500
committerJeff Moyer <jmoyer@redhat.com>2018-01-12 13:51:51 -0500
commit97fd3fc0195500e616e34047cba4846164c411d9 (patch)
tree32f6069b88c93485f3c40e3b1d5c3e86752d23af /src/syscall-generic.h
parentb112f6b45d995043614dd79e032753b0741c86d2 (diff)
downloadlibaio-syscall-refactor.tar.gz
syscall: get rid of custom syscall implementationsyscall-refactor
Maintaining the custom system call code for each architecture is a burden. I'm not convinced that we have clobber registers correct, and at best, we are just duplicating work that has already been done by the glibc maintainers. I asked Ben what the reasoning was behind not just using syscall. This was his answer: The main issue was that glibc's pthreads implementation really sucked back during initial development and there was a use-case for having the io_XXX functions usable directly from clone()ed threads that didn't have all the glibc pthread state setup for per-cpu areas to handle per-thread errno. That made sense back then, but is rather silly today. This patch gets rid of the architecture specific system call wrappers in favor of using syscall(). We leave the per-arch header files with the syscall numbers because we'll be adding a new system call soon, and this will allow us to add the new number without requiring newer kernels on build servers. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Diffstat (limited to 'src/syscall-generic.h')
-rw-r--r--src/syscall-generic.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/syscall-generic.h b/src/syscall-generic.h
deleted file mode 100644
index 44d57f3..0000000
--- a/src/syscall-generic.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <errno.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-
-#define _body_io_syscall(sname, args...) \
-{ \
- int ret, saved_errno; \
- saved_errno = errno; \
- ret= syscall(__NR_##sname, ## args); \
- if (ret < 0) { \
- ret = -errno; \
- errno = saved_errno; \
- } \
- return ret; \
-}
-
-#define io_syscall1(type,fname,sname,type1,arg1) \
-type fname(type1 arg1) \
-_body_io_syscall(sname, (long)arg1)
-
-#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
-type fname(type1 arg1,type2 arg2) \
-_body_io_syscall(sname, (long)arg1, (long)arg2)
-
-#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
-type fname(type1 arg1,type2 arg2,type3 arg3) \
-_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3)
-
-#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
-type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
-_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4)
-
-#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, type5,arg5) \
-type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
-_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4, (long)arg5)