* include/fcntl.h (O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_APPEND, O_TRUNC)[__GNU__]: Specialize for GNU. * lib/gnu/dir-lookup.c: New file. * lib/stdio/fopen.c (fopen): Use O_RDONLY. * lib/tests/posix/50-open-read.c (main): Likewise. * lib/tests/stdio/90-fseek.c (main): Likewise. * include/gnu/syscall.h (SYS__dir_lookup): New value. * lib/gnu/_open3.c: New file. * build-aux/configure-lib.sh (libc_SOURCES): Build them.
* build-aux/pre-inst-env.in (srcdir): Remove. (abs_top_srcdir, abs_top_builddir): Export. * lib/tests/posix/50-open-read.c (main): Use abs_top_srcdir.
* build-aux/test-c.sh: Support running by hand. * lib/tests/posix/50-open-read.c: New test. * lib/tests/posix/data/open-read: New file. * build-aux/check-mescc.sh (TESTS): Add it.