summaryrefslogtreecommitdiff
path: root/src/fcntl/fcntl.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-31 16:06:48 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-31 16:06:48 -0500
commit34386fe72b733e12f5ab45bf1d4f5b59621c3a96 (patch)
treecd3e90f47f9c46f234df635d91c133b2e8a8f94d /src/fcntl/fcntl.c
parent57fd57ab4005e37bfab4bf7c637eecc1eb5445b5 (diff)
remove more cruft
Diffstat (limited to 'src/fcntl/fcntl.c')
-rw-r--r--src/fcntl/fcntl.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/fcntl/fcntl.c b/src/fcntl/fcntl.c
deleted file mode 100644
index a66a5ec3..00000000
--- a/src/fcntl/fcntl.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#if 0
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdarg.h>
-#include "_syscall.h"
-
-int fcntl(int fildes, int cmd, ...)
-{
- SYSCALL_NUMBER(scno, fcntl, -1);
-
- int r = -ENOSYS;
- enum { NONE, INT, FLOCK } arg = NONE;
-
- switch (cmd) {
- case F_GETFD:
- case F_GETFL:
- break;
-
- case F_DUPFD:
- case F_SETFD:
- case F_SETFL:
- arg = INT;
- break;
-
- case F_GETLK:
- case F_SETLK:
- case F_SETLKW:
- arg = FLOCK;
- break;
-
- default:
- errno = EINVAL;
- return -1;
- }
-
- if (arg == NONE) {
- r = __syscall(scno, fildes);
- } else {
- va_list ap;
- va_start(ap, cmd);
- if (arg == INT) {
- int n = va_arg(ap, int);
- r = __syscall(scno, fildes, n);
- } else if (arg == FLOCK) {
- struct flock *fl = va_arg(ap, struct flock *);
- r = __syscall(scno, fildes, fl);
- }
- va_end(ap);
- }
-
- if (r < 0) {
- errno = -r;
- return -1;
- }
-
- return r;
-}
-/*
-POSIX(1)
-*/
-
-
-#endif