diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-23 15:22:33 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-23 15:22:33 -0500 |
| commit | 1221e834f49adb91eb0b7443a57274f2611459c2 (patch) | |
| tree | 7afb7ed5a203ddefd5559005af7ec61d801b972e /src/fcntl | |
| parent | f546f27d1fdb8d2663b2fbb130f53ee32cac90b0 (diff) | |
compile in current environment
Diffstat (limited to 'src/fcntl')
| -rw-r--r-- | src/fcntl/fcntl.c | 9 | ||||
| -rw-r--r-- | src/fcntl/open.c | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/fcntl/fcntl.c b/src/fcntl/fcntl.c index 18288776..b02745e9 100644 --- a/src/fcntl/fcntl.c +++ b/src/fcntl/fcntl.c @@ -2,12 +2,11 @@ #include <fcntl.h> #include "errno.h" #include "stdarg.h" -#include "nonstd/types.h" #include "nonstd/syscall.h" int fcntl(int fildes, int cmd, ...) { - SCNO(scno, "fcntl", -1); + SYSCALL_NUMBER(scno, "fcntl", -1); int r = -ENOSYS; enum { NONE, INT, FLOCK } arg = NONE; @@ -35,16 +34,16 @@ int fcntl(int fildes, int cmd, ...) } if (arg == NONE) { - r = __libc.syscall(scno, fildes); + r = __syscall(scno, fildes); } else { va_list ap; va_start(ap, cmd); if (arg == INT) { int n = va_arg(ap, int); - r = __libc.syscall(scno, fildes, n); + r = __syscall(scno, fildes, n); } else if (arg == FLOCK) { struct flock *fl = va_arg(ap, struct flock *); - r = __libc.syscall(scno, fildes, fl); + r = __syscall(scno, fildes, fl); } va_end(ap); } diff --git a/src/fcntl/open.c b/src/fcntl/open.c index f0968556..07bf7f6d 100644 --- a/src/fcntl/open.c +++ b/src/fcntl/open.c @@ -7,7 +7,7 @@ int open(const char *path, int oflag, ...) { - SCNO(scno, "open", -1); + SYSCALL_NUMBER(scno, "open", -1); mode_t mode = 0; if (oflag & O_CREAT) { @@ -17,7 +17,7 @@ int open(const char *path, int oflag, ...) va_end(ap); } - int r = __libc.syscall(scno, path, oflag, mode); + int r = __syscall(scno, path, oflag, mode); if (r < 0) { errno = -r; return -1; |
