From 675e4015896d39a88264d4db515c6824bdd6bf27 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 7 Sep 2000 06:21:02 +0000 Subject: [PATCH] Update. * sysdeps/unix/opendir.c: If O_DIRECTORY_WORKS is defined don't use the hack with tryopen_o_directory to determine at runtime whether it works. * sysdeps/unix/sysv/linux/opendir.c: New file. * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_O_DIRECTORY if kernel knows O_DIRECTORY. --- ChangeLog | 7 +++++++ sysdeps/unix/opendir.c | 5 +++++ sysdeps/unix/sysv/linux/kernel-features.h | 6 ++++++ sysdeps/unix/sysv/linux/opendir.c | 26 ++++++++++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/opendir.c diff --git a/ChangeLog b/ChangeLog index 6c3267f..821c737 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2000-09-06 Ulrich Drepper + * sysdeps/unix/opendir.c: If O_DIRECTORY_WORKS is defined don't + use the hack with tryopen_o_directory to determine at runtime + whether it works. + * sysdeps/unix/sysv/linux/opendir.c: New file. + * sysdeps/unix/sysv/linux/kernel-features.h: Define + __ASSUME_O_DIRECTORY if kernel knows O_DIRECTORY. + * catgets/Depend: New file. Add intl. * catgets/Makefile (tests): Add tst-catgets. (generated): Remove de.msg. diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index cf030e0..ad91931 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -40,6 +40,10 @@ a guinea pig. It may be missing in chroot environments, so we make sure to fail safe. */ #ifdef O_DIRECTORY +# ifdef O_DIRECTORY_WORKS +# define o_directory_works 1 +# define tryopen_o_directory() while (1) /* This must not be called. */ +# else static int o_directory_works; static void @@ -60,6 +64,7 @@ tryopen_o_directory (void) __set_errno (serrno); } +# endif # define EXTRA_FLAGS O_DIRECTORY #else # define EXTRA_FLAGS 0 diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 2f9d12b..c7ff66e 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -142,3 +142,9 @@ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_GETDENTS64_SYSCALL 1 #endif + +/* When did O_DIRECTORY became available? Early in 2.3 but when? + Be safe, use 2.3.99. */ +#if __LINUX_KERNEL_VERSION >= 131939 +# define __ASSUME_O_DIRECTORY 1 +#endif diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c new file mode 100644 index 0000000..f58b379 --- /dev/null +++ b/sysdeps/unix/sysv/linux/opendir.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2000 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 + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "kernel-features.h" + + +#ifdef __ASSUME_O_DIRECTORY +# define O_DIRECTORY_WORKS 1 +#endif + +#include -- 2.7.4