Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove __ASSUME_F_GETOWN_EX.
This patch removes __ASSUME_F_GETOWN_EX now it can be assumed to be
true unconditionally.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch.

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_F_GETOWN_EX): Remove macro.
	* sysdeps/unix/sysv/linux/fcntl.c: Do not include
	<kernel-features.h>.
	(miss_F_GETOWN_EX): Remove variable or macro.
	(do_fcntl): Do not check miss_F_GETOWN_EX.
	(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.
  • Loading branch information
Joseph Myers committed Jun 20, 2014
1 parent 4a10397 commit 7fd00f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,5 +1,13 @@
2014-06-20 Joseph Myers <joseph@codesourcery.com>

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_F_GETOWN_EX): Remove macro.
* sysdeps/unix/sysv/linux/fcntl.c: Do not include
<kernel-features.h>.
(miss_F_GETOWN_EX): Remove variable or macro.
(do_fcntl): Do not check miss_F_GETOWN_EX.
(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.

* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
Remove macro.
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
Expand Down
19 changes: 1 addition & 18 deletions sysdeps/unix/sysv/linux/fcntl.c
Expand Up @@ -22,20 +22,12 @@
#include <stdarg.h>

#include <sys/syscall.h>
#include <kernel-features.h>


#ifdef __ASSUME_F_GETOWN_EX
# define miss_F_GETOWN_EX 0
#else
static int miss_F_GETOWN_EX;
#endif


static int
do_fcntl (int fd, int cmd, void *arg)
{
if (cmd != F_GETOWN || miss_F_GETOWN_EX)
if (cmd != F_GETOWN)
return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);

INTERNAL_SYSCALL_DECL (err);
Expand All @@ -44,15 +36,6 @@ do_fcntl (int fd, int cmd, void *arg)
if (!INTERNAL_SYSCALL_ERROR_P (res, err))
return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;

#ifndef __ASSUME_F_GETOWN_EX
if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
{
res = INLINE_SYSCALL (fcntl, 3, fd, F_GETOWN, arg);
miss_F_GETOWN_EX = 1;
return res;
}
#endif

__set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
return -1;
}
Expand Down
3 changes: 0 additions & 3 deletions sysdeps/unix/sysv/linux/kernel-features.h
Expand Up @@ -173,9 +173,6 @@
# define __ASSUME_REQUEUE_PI 1
#endif

/* Support for F_GETOWN_EX was introduced in 2.6.32. */
#define __ASSUME_F_GETOWN_EX 1

/* Support for recvmmsg functionality was added in 2.6.33. The macros
defined correspond to those for accept4. */
#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __ASSUME_SOCKETCALL
Expand Down

0 comments on commit 7fd00f9

Please sign in to comment.