1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <sys/syscall.h>
- #undef INLINE_SYSCALL
- #define INLINE_SYSCALL(func, numargs, args...) syscall(__NR_ ## func, args)
- #define open_not_cancel(name, flags, mode) \
- INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
- #define open_not_cancel_2(name, flags) \
- INLINE_SYSCALL (open, 2, (const char *) (name), (flags))
- #define close_not_cancel(fd) \
- INLINE_SYSCALL (close, 1, fd)
- #define close_not_cancel_no_status(fd) \
- (void) ({ INTERNAL_SYSCALL_DECL (err); \
- INTERNAL_SYSCALL (close, err, 1, (fd)); })
- #define read_not_cancel(fd, buf, n) \
- INLINE_SYSCALL (read, 3, (fd), (buf), (n))
- #define write_not_cancel(fd, buf, n) \
- INLINE_SYSCALL (write, 3, (fd), (buf), (n))
- #define writev_not_cancel_no_status(fd, iov, n) \
- (void) ({ INTERNAL_SYSCALL_DECL (err); \
- INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
- #define fcntl_not_cancel(fd, cmd, val) \
- __fcntl_nocancel (fd, cmd, val)
- #ifdef __NR_waitpid
- # define waitpid_not_cancel(pid, stat_loc, options) \
- INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options)
- #else
- # define waitpid_not_cancel(pid, stat_loc, options) \
- INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
- #endif
|