aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/fcntl.c')
-rw-r--r--sysdeps/unix/sysv/linux/fcntl.c41
1 files changed, 3 insertions, 38 deletions
diff --git a/sysdeps/unix/sysv/linux/fcntl.c b/sysdeps/unix/sysv/linux/fcntl.c
index a3cb2aea10..e3992dc9d4 100644
--- a/sysdeps/unix/sysv/linux/fcntl.c
+++ b/sysdeps/unix/sysv/linux/fcntl.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
+/* Linux fcntl syscall implementation.
+ Copyright (C) 2000-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,24 +30,6 @@
# define FCNTL_ADJUST_CMD(__cmd) __cmd
#endif
-static int
-fcntl_common (int fd, int cmd, void *arg)
-{
- if (cmd == F_GETOWN)
- {
- INTERNAL_SYSCALL_DECL (err);
- struct f_owner_ex fex;
- int res = INTERNAL_SYSCALL_CALL (fcntl64, err, fd, F_GETOWN_EX, &fex);
- if (!INTERNAL_SYSCALL_ERROR_P (res, err))
- return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
-
- return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (res,
- err));
- }
-
- return INLINE_SYSCALL_CALL (fcntl64, fd, cmd, (void *) arg);
-}
-
int
__libc_fcntl (int fd, int cmd, ...)
{
@@ -62,28 +45,10 @@ __libc_fcntl (int fd, int cmd, ...)
if (cmd == F_SETLKW || cmd == F_SETLKW64)
return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);
- return fcntl_common (fd, cmd, arg);
+ return __fcntl_nocancel_adjusted (fd, cmd, arg);
}
libc_hidden_def (__libc_fcntl)
-#if !IS_IN (rtld)
-int
-__fcntl_nocancel (int fd, int cmd, ...)
-{
- va_list ap;
- void *arg;
-
- va_start (ap, cmd);
- arg = va_arg (ap, void *);
- va_end (ap);
-
- return fcntl_common (fd, cmd, arg);
-}
-#else
-strong_alias (__libc_fcntl, __fcntl_nocancel)
-#endif
-libc_hidden_def (__fcntl_nocancel)
-
weak_alias (__libc_fcntl, __fcntl)
libc_hidden_weak (__fcntl)
weak_alias (__libc_fcntl, fcntl)