From: Johannes S. <js...@co...> - 2002-05-27 15:15:55
|
On Mon, May 27, 2002 at 02:44:50PM +0200, Johannes Stezenbach wrote: > I also cheated in the kernel/syscalls/open/* test cases, > because #include <asm/fnctl.h> fails (undefined types used). > I used #include <fnctl.h> and #define O_DIRECTORY 0x10000 > as a work around. IMHO this is a glibc problem. I checked this again, and open(2) says: CONFORMING TO SVr4, SVID, POSIX, X/OPEN, BSD 4.3 The O_NOFOLLOW and O_DIRECTORY flags are Linux-specific. One may have to define the _GNU_SOURCE macro to get their definitions. So I guess the following patch fixes it correctly. Regards, Johannes Index: testcases/kernel/syscalls/open/open01.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/open/open01.c,v retrieving revision 1.1 diff -u -r1.1 open01.c --- testcases/kernel/syscalls/open/open01.c 27 Aug 2001 22:15:14 -0000 1.1 +++ testcases/kernel/syscalls/open/open01.c 27 May 2002 15:10:23 -0000 @@ -48,9 +48,10 @@ * RESTRICTIONS * None */ +#define _GNU_SOURCE /* for O_DIRECTORY */ #include <sys/types.h> #include <sys/stat.h> -#include <asm/fcntl.h> /* for O_DIRECTORY */ +#include <fcntl.h> #include <errno.h> #include "test.h" #include "usctest.h" Index: testcases/kernel/syscalls/open/open07.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/open/open07.c,v retrieving revision 1.1 diff -u -r1.1 open07.c --- testcases/kernel/syscalls/open/open07.c 27 Aug 2001 22:15:14 -0000 1.1 +++ testcases/kernel/syscalls/open/open07.c 27 May 2002 15:10:23 -0000 @@ -55,11 +55,12 @@ * RESTRICTIONS * None */ +#define _GNU_SOURCE /* for O_NOFOLLOW */ #include <stdio.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> -#include <asm/fcntl.h> /* for O_NOFOLLOW definition */ +#include <fcntl.h> #include "test.h" #include "usctest.h" Index: testcases/kernel/syscalls/open/open08.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/open/open08.c,v retrieving revision 1.5 diff -u -r1.5 open08.c --- testcases/kernel/syscalls/open/open08.c 14 May 2002 16:50:07 -0000 1.5 +++ testcases/kernel/syscalls/open/open08.c 27 May 2002 15:10:23 -0000 @@ -46,10 +46,11 @@ * RESTRICTIONS * None */ +#define _GNU_SOURCE /* for O_DIRECTORY */ #include <stdio.h> #include <errno.h> #include <sys/types.h> -#include <asm/fcntl.h> /* for O_DIRECTORY definition */ +#include <fcntl.h> #include <signal.h> #include <pwd.h> #include "test.h" |