summaryrefslogtreecommitdiff
path: root/m4/sys_stat_h.m4
Commit message (Collapse)AuthorAgeFilesLines
* Add comments after 2021-04-11 change.Bruno Haible2021-04-181-1/+8
| | | | | * m4/*_h.m4: Add comments regarding *_REQUIRE_DEFAULTS and *_MODULE_INDICATOR macros.
* Support several gnulib-tool invocations under the same configure.ac.Bruno Haible2021-04-111-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00104.html>. This is done by defining the Gnulib module indicator variables per gnulib-tool invocation. So that a generated .h file is no longer influenced by the set of modules used in other gnulib-tool invocations. * gnulib-tool (func_compute_include_guard_prefix): Set module_indicator_prefix. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Use it to modify $(GNULIB_*) variable references in the Automake snippets. (func_emit_initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (func_emit_initmacro_end): Pop these macro definitions. * pygnulib/GLConfig.py (GLConfig.getIncludeGuardPrefix): New method. * pygnulib/GLEmiter.py (GLEmiter.initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (GLEmiter.initmacro_end): Pop these macro definitions. (GLEmiter.lib_Makefile_am, GLEmiter.tests_Makefile_am): Use the module indicator prefix to modify $(GNULIB_*) variable references in the Automake snippets. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE, gl_MODULE_INDICATOR_SET_VARIABLE): Use the value of GL_MODULE_INDICATOR_PREFIX. * m4/arpa_inet_h.m4: Use new idiom for header files that contain references to Gnulib module indicator variables: - Define the main macro through AC_DEFUN_ONCE. - Define a macro gl_*_H_REQUIRE_DEFAULTS that initializes the Gnulib module indicator variables (each prefixed with GL_MODULE_INDICATOR_PREFIX). - Invoke this macro in the gl_*_MODULE_INDICATOR macro. * m4/ctype.m4: Likewise. * m4/dirent_h.m4: Likewise. * m4/fcntl_h.m4: Likewise. * m4/fnmatch_h.m4: Likewise. * m4/glob_h.m4: Likewise. * m4/iconv_h.m4: Likewise. * m4/inttypes.m4: Likewise. * m4/langinfo_h.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/malloc_h.m4: Likewise. * m4/math_h.m4: Likewise. * m4/monetary_h.m4: Likewise. * m4/netdb_h.m4: Likewise. * m4/poll_h.m4: Likewise. * m4/pthread_h.m4: Likewise. * m4/pty_h.m4: Likewise. * m4/sched_h.m4: Likewise. * m4/search_h.m4: Likewise. * m4/signal_h.m4: Likewise. * m4/spawn_h.m4: Likewise. * m4/stddef_h.m4: Likewise. * m4/stdio_h.m4: Likewise. * m4/stdlib_h.m4: Likewise. * m4/string_h.m4: Likewise. * m4/strings_h.m4: Likewise. * m4/sys_file_h.m4: Likewise. * m4/sys_ioctl_h.m4: Likewise. * m4/sys_random_h.m4: Likewise. * m4/sys_resource_h.m4: Likewise. * m4/sys_select_h.m4: Likewise. * m4/sys_socket_h.m4: Likewise. * m4/sys_stat_h.m4: Likewise. * m4/sys_time_h.m4: Likewise. * m4/sys_times_h.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/sys_uio_h.m4: Likewise. * m4/sys_utsname_h.m4: Likewise. * m4/sys_wait_h.m4: Likewise. * m4/termios_h.m4: Likewise. * m4/threads.m4: Likewise. * m4/time_h.m4: Likewise. * m4/uchar.m4: Likewise. * m4/unistd_h.m4: Likewise. * m4/utime_h.m4: Likewise. * m4/wchar_h.m4: Likewise. * m4/wctype_h.m4: Likewise. * modules/arpa_inet (configure.ac): Invoke the macro gl_*_H_REQUIRE_DEFAULTS explicitly. * modules/ctype (configure.ac): Likewise. * modules/dirent (configure.ac): Likewise. * modules/fcntl-h (configure.ac): Likewise. * modules/fnmatch-h (configure.ac): Likewise. * modules/glob-h (configure.ac): Likewise. * modules/iconv-h (configure.ac): Likewise. * modules/inttypes-incomplete (configure.ac): Likewise. * modules/langinfo (configure.ac): Likewise. * modules/locale (configure.ac): Likewise. * modules/malloc-h (configure.ac): Likewise. * modules/math (configure.ac): Likewise. * modules/monetary (configure.ac): Likewise. * modules/netdb (configure.ac): Likewise. * modules/poll-h (configure.ac): Likewise. * modules/pthread-h (configure.ac): Likewise. * modules/pty (configure.ac): Likewise. * modules/sched (configure.ac): Likewise. * modules/search (configure.ac): Likewise. * modules/signal-h (configure.ac): Likewise. * modules/spawn (configure.ac): Likewise. * modules/stddef (configure.ac): Likewise. * modules/stdio (configure.ac): Likewise. * modules/stdlib (configure.ac): Likewise. * modules/string (configure.ac): Likewise. * modules/strings (configure.ac): Likewise. * modules/sys_file (configure.ac): Likewise. * modules/sys_ioctl (configure.ac): Likewise. * modules/sys_random (configure.ac): Likewise. * modules/sys_resource (configure.ac): Likewise. * modules/sys_select (configure.ac): Likewise. * modules/sys_socket (configure.ac): Likewise. * modules/sys_stat (configure.ac): Likewise. * modules/sys_time (configure.ac): Likewise. * modules/sys_times (configure.ac): Likewise. * modules/sys_types (configure.ac): Likewise. * modules/sys_uio (configure.ac): Likewise. * modules/sys_utsname (configure.ac): Likewise. * modules/sys_wait (configure.ac): Likewise. * modules/termios (configure.ac): Likewise. * modules/threads-h (configure.ac): Likewise. * modules/time (configure.ac): Likewise. * modules/uchar (configure.ac): Likewise. * modules/unistd (configure.ac): Likewise. * modules/utime-h (configure.ac): Likewise. * modules/wchar (configure.ac): Likewise. * modules/wctype-h (configure.ac): Likewise. * m4/af_alg.m4: Update after a macro name changed. * m4/ctime.m4: Likewise. * m4/explicit_bzero.m4: Likewise. * m4/ffs.m4: Likewise. * m4/ffsl.m4: Likewise. * m4/ffsll.m4: Likewise. * m4/flock.m4: Likewise. * m4/fstat.m4: Likewise. * m4/getaddrinfo.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/gettimeofday.m4: Likewise. * m4/hostent.m4: Likewise. * m4/ioctl.m4: Likewise. * m4/localtime.m4: Likewise. * m4/mbslen.m4: Likewise. * m4/memchr.m4: Likewise. * m4/memmem.m4: Likewise. * m4/mempcpy.m4: Likewise. * m4/memrchr.m4: Likewise. * m4/mktime.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/passfd.m4: Likewise. * m4/pselect.m4: Likewise. * m4/rawmemchr.m4: Likewise. * m4/select.m4: Likewise. * m4/servent.m4: Likewise. * m4/sigabbrev_np.m4: Likewise. * m4/sigdescr_np.m4: Likewise. * m4/sockpfaf.m4: Likewise. * m4/stat.m4: Likewise. * m4/stpcpy.m4: Likewise. * m4/stpncpy.m4: Likewise. * m4/strcase.m4: Likewise. * m4/strcasestr.m4: Likewise. * m4/strchrnul.m4: Likewise. * m4/strdup.m4: Likewise. * m4/strerror.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/strerrorname_np.m4: Likewise. * m4/strftime-fixes.m4: Likewise. * m4/strncat.m4: Likewise. * m4/strndup.m4: Likewise. * m4/strnlen.m4: Likewise. * m4/strpbrk.m4: Likewise. * m4/strptime.m4: Likewise. * m4/strsep.m4: Likewise. * m4/strsignal.m4: Likewise. * m4/strstr.m4: Likewise. * m4/strtok_r.m4: Likewise. * m4/strverscmp.m4: Likewise. * m4/time_r.m4: Likewise. * m4/time_rz.m4: Likewise. * m4/timegm.m4: Likewise. * m4/timespec_get.m4: Likewise. * m4/tzset.m4: Likewise. * modules/accept (configure.ac): Likewise. * modules/bind (configure.ac): Likewise. * modules/connect (configure.ac): Likewise. * modules/flock (configure.ac): Likewise. * modules/getpeername (configure.ac): Likewise. * modules/getsockname (configure.ac): Likewise. * modules/getsockopt (configure.ac): Likewise. * modules/listen (configure.ac): Likewise. * modules/recv (configure.ac): Likewise. * modules/recvfrom (configure.ac): Likewise. * modules/send (configure.ac): Likewise. * modules/sendto (configure.ac): Likewise. * modules/setsockopt (configure.ac): Likewise. * modules/shutdown (configure.ac): Likewise. * modules/socket (configure.ac): Likewise. Use the gl_*_H_REQUIRE_DEFAULTS macros. * modules/nonblocking (configure.ac): Use the gl_*_H_REQUIRE_DEFAULTS and gl_MODULE_INDICATOR_INIT_VARIABLE macros. * modules/sigpipe (configure.ac): Likewise. * modules/windows-stat-override (configure.ac): Likewise. * m4/nonblocking.m4: Update a comment. * m4/sigpipe.m4: Likewise.
* Simplify GNULIB_* variable initializations.Bruno Haible2021-04-111-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE): New macro. * m4/arpa_inet_h.m4 (gl_ARPA_INET_H_DEFAULTS): Use it. * m4/ctype.m4 (gl_CTYPE_H_DEFAULTS): Likewise. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Likewise. * m4/fnmatch_h.m4 (gl_FNMATCH_H_DEFAULTS): Likewise. * m4/glob_h.m4 (gl_GLOB_H_DEFAULTS): Likewise. * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Likewise. * m4/langinfo_h.m4 (gl_LANGINFO_H_DEFAULTS): Likewise. * m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Likewise. * m4/malloc_h.m4 (gl_MALLOC_H_DEFAULTS): Likewise. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise. * m4/monetary_h.m4 (gl_MONETARY_H_DEFAULTS): Likewise. * m4/netdb_h.m4 (gl_NETDB_H_DEFAULTS): Likewise. * m4/poll_h.m4 (gl_POLL_H_DEFAULTS): Likewise. * m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Likewise. * m4/pty_h.m4 (gl_PTY_H_DEFAULTS): Likewise. * m4/sched_h.m4 (gl_SCHED_H_DEFAULTS): Likewise. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H_DEFAULTS): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_DEFAULTS): Likewise. * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H_DEFAULTS): Likewise. * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H_DEFAULTS): Likewise. * m4/sys_random_h.m4 (gl_SYS_RANDOM_H_DEFAULTS): Likewise. * m4/sys_resource_h.m4 (gl_SYS_RESOURCE_H_DEFAULTS): Likewise. * m4/sys_select_h.m4 (gl_SYS_SELECT_H_DEFAULTS): Likewise. * m4/sys_socket_h.m4 (gl_SYS_SOCKET_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): Likewise. * m4/sys_times_h.m4 (gl_SYS_TIMES_H_DEFAULTS): Likewise. * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H_DEFAULTS): Likewise. * m4/sys_wait_h.m4 (gl_SYS_WAIT_H_DEFAULTS): Likewise. * m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Likewise. * m4/threads.m4 (gl_THREADS_H_DEFAULTS): Likewise. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise. * m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Likewise.
* mkfifoat: Work around trailing slash bug in mknodat() on AIX 7.2.Bruno Haible2021-01-051-1/+2
| | | | | | | | | | * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Set also REPLACE_MKNODAT. * lib/sys_stat.in.h (mknodat): Consider REPLACE_MKNODAT. * lib/mknodat.c: Add an overriding implementation of mknodat(). * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_MKNODAT. * modules/sys_stat (Makefile.am): Substitute REPLACE_MKNODAT. * modules/mkfifoat (Depends-on, configure.ac): Consider REPLACE_MKNODAT. * doc/posix-functions/mknodat.texi: Mention the AIX bug.
* mkfifoat: Work around trailing slash bug in mkfifoat() on AIX 7.2.Bruno Haible2021-01-051-1/+2
| | | | | | | | | | | | | * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Add a test whether mkfifoat rejects trailing slashes. Set REPLACE_MKFIFOAT if not. * lib/sys_stat.in.h (mkfifoat): Consider REPLACE_MKFIFOAT. * lib/mkfifoat.c: Add an overriding implementation of mkfifoat(). * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize REPLACE_MKFIFOAT. * modules/sys_stat (Makefile.am): Substitute REPLACE_MKFIFOAT. * modules/mkfifoat (Depends-on): Add fstatat. (configure.ac): Consider REPLACE_MKFIFOAT. * doc/posix-functions/mkfifoat.texi: Mention the AIX bug.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* Make it possible to turn off the mkdir override on Windows.Bruno Haible2020-12-251-1/+3
| | | | | | | | | | | * lib/sys_stat.in.h (mkdir): Conditionalize through GNULIB_MKDIR and GNULIB_MDA_MKDIR. Also support GNULIB_POSIXCHECK. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_MKDIR, GNULIB_MDA_MKDIR. * modules/sys_stat (Makefile.am): Substitute GNULIB_MKDIR, GNULIB_MDA_MKDIR. * modules/mkdir (configure.ac): Invoke gl_SYS_STAT_MODULE_INDICATOR. * doc/posix-functions/mkdir.texi: Mention also the 'sys_stat' module.
* Make it possible to turn off each of the Windows oldnames workarounds.Bruno Haible2020-12-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/fcntl.in.h (creat, open): Conditionalize each of the Windows oldnames workarounds through a GNULIB_MDA_<func> symbol. * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise. * lib/search.in.h (lfind, lsearch): Likewise. * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam): Likewise. * lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise. * lib/string.in.h (memccpy, strdup): Likewise. * lib/sys_stat.in.h (chmod, umask): Likewise. * lib/time.in.h (tzset): Likewise. * lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle, execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek, read, rmdir, swab, unlink, write): Likewise. * lib/utime.in.h (utime): Likewise. * lib/wchar.in.h (wcsdup): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these GNULIB_MDA_<func> symbols. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise. * modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func> symbols. * modules/math (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/utime-h (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise.
* getumask: New module.Bruno Haible2020-07-041-3/+5
| | | | | | | | | | | | | | | * lib/sys_stat.in.h (getumask): New declaration. * lib/getumask.c: New file. * m4/getumask.m4: New file. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Test whether getumask is declared. (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_GETUMASK, HAVE_GETUMASK. * modules/sys_stat (Makefile.am): Substitute GNULIB_GETUMASK, HAVE_GETUMASK. * modules/getumask: New file. * tests/test-sys_stat-c++.cc (getumask): Check signature. * doc/glibc-functions/getumask.texi: New file. * doc/gnulib.texi (Glibc sys/stat.h): Include it.
* fchmodat, lchmod: simplifyPaul Eggert2020-02-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that we may have overengineered lchmod and fchmodat, in that the code was prepared for some hypothetical platforms but was so complicated that it was hard to understand. I attempted to improve the situation by simplifying the code when this simplification should not hurt on real platforms; we can re-add complexity later to port to platforms I didn’t know about. * lib/fchmodat.c (fchmodat): * lib/lchmod.c (lchmod): Put the ‘defined __linux__ || defined __ANDROID__’ #ifdef only around the /proc code that needs it. * lib/fchmodat.c (fchmodat): Coalese calls to orig_fchmodat. * lib/lchmod.c (__need_system_sys_stat_h): Omit; no longer needed. Do not include <config.h> twice. (orig_lchmod) [HAVE_LCHMOD]: Remove, since we need not wrap lchmod on any known hosts. (lchmod): Do not defer to fchmodat, so that the lchmod module need not depend on the fchmodat module (which is a circular dependency). Do not use openat, since ‘open’ suffices. Coalesce calls to lchmod/chmod. * lib/lchmod.c, lib/sys_stat.in.h (lchmod): * m4/sys_stat_h.m4 (REPLACE_FSTAT): * modules/lchmod (Depends-on, configure.ac): * modules/sys_stat (Depends-on): Do not worry about replacing lchmod, since that shouldn’t happen. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Do not check for fchmodat. Do not worry about whether lchmod works on non-symlinks, since every known lchmod works on non-symlinks. * modules/lchmod (Depends-on): Remove circular dependency on fchmodat.
* Use 'restrict' in all POSIX function declarations.Bruno Haible2020-02-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/iconv.in.h (iconv): Use 'restrict'. * lib/inttypes.in.h (strtoimax, strtoumax): Likewise. * lib/monetary.in.h (strfmon_l): Likewise. * lib/pthread.in.h (pthread_create, pthread_mutex_init, pthread_mutexattr_gettype, pthread_mutexattr_getrobust, pthread_mutex_timedlock, pthread_rwlock_init, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock, pthread_cond_init, pthread_cond_wait, pthread_cond_timedwait): Likewise. * lib/search.in.h (tdelete): Likewise. * lib/signal.in.h (pthread_sigmask, sigprocmask): Likewise. * lib/stdio.in.h (dprintf, fgets, fopen, fprintf, fputs, fread, freopen, fscanf, fwrite, getdelim, getline, printf, scanf, snprintf, sprintf, vdprintf, vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf): Likewise. * lib/stdlib.in.h (mbtowc, realpath, strtod, strtold, strtoll, strtoull): Likewise. * lib/string.in.h (strncat): Likewise. * lib/sys_socket.in.h (accept, getpeername, getsockname, getsockopt, recvfrom): Likewise. * lib/sys_stat.in.h (fstatat, lstat, stat): Likewise. * lib/time.in.h (strftime): Likewise. * lib/unistd.in.h (readlink, readlinkat): Likewise. * lib/wchar.in.h (mbrtowc, mbrlen, mbsrtowcs, mbsnrtowcs, wcrtomb, wcsrtombs, wcsnrtombs, wmemcpy, wcscpy, wcpcpy, wcsncpy, wcpncpy, wcscat, wcsncat, wcsxfrm, wcsstr, wcstok, wcsftime): Likewise. * m4/iconv_h.m4 (gl_ICONV_H): Require AC_C_RESTRICT. * m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Likewise. * m4/monetary_h.m4 (gl_MONETARY_H): Likewise. * m4/search_h.m4 (gl_SEARCH_H): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Make consistent with the other *_h.m4 files. * m4/time_h.m4 (gl_HEADER_TIME_H): Likewise.
* fchmodat: AT_SYMLINK_NOFOLLOW fix for non-symlinksPaul Eggert2020-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lchmod, and fchmodat with AT_SYMLINK_NOFOLLOW, so that they act like chmod on non-symlinks. * NEWS: * doc/glibc-functions/lchmod.texi (lchmod): * doc/posix-functions/fchmodat.texi (fchmodat): Mention this. * lib/fchmodat.c: Define __need_system_sys_stat_h before including config.h, and undef it after including sys/stat.h the first time. Include fcntl.h, stdio.h, unistd.h, intprops.h, and include sys/stat.h a second time after defining orig_fchmodat. (orig_fchmodat) [HAVE_FCHMODAT]: New function. (fchmodat) [HAVE_FCHMODAT]: Work around the AT_SYMLINK_NOFOLLOW bug. * lib/lchmod.c: New file. * lib/sys_stat.in.h (fchmodat, lchmod): Support replacing these functions. * m4/fchmodat.m4 (gl_FUNC_FCHMODAT): If fchmodat exists, test that AT_SYMLINK_NOFOLLOW works on non-symlinks. * m4/lchmod.m4 (gl_FUNC_LCHMOD): Check for lstat. Test that lchmod works on non-symlinks. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Default REPLACE_FCHMODAT and REPLACE_LCHMOD to 0. * modules/fchmodat (Depends-on): Add fstatat, intprops, lchmod, unistd. (Depends-on, configure.ac): Check REPLACE_FCHMODAT too. * modules/lchmod (Files): Add lib/lchmod.c. (Depends-on): Add errno, fcntl-h, fchmodat, intprops, lstat, unistd. (configure.ac): Compile lchmod.c if needed. (lib_SOURCES): Add lchmod.c. * modules/sys_stat (sys/stat.h): Substitute REPLACE_FCHMODAT and REPLACE_LCHMOD. * tests/test-fchmodat.c: Include fcntl.h, sys/stat.h. (main): Test fchmodat with AT_SYMLINK_NOFOLLOW on non-symlinks.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* largefile: Simplify.Bruno Haible2017-05-131-7/+2
| | | | | * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Remove unused definition of _GL_WINDOWS_64_BIT_ST_SIZE.
* windows-stat-timespec: New module.Bruno Haible2017-05-131-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | * modules/windows-stat-timespec: New file. * m4/windows-stat-timespec.m4: New file. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_STAT_TIMESPEC. * modules/sys_stat (Makefile.am): Substitute WINDOWS_STAT_TIMESPEC. * lib/sys_stat.in.h (struct stat) [WINDOWS_STAT_TIMESPEC]: Declare with fields st_atim, st_mtim, st_ctim. (st_atime, st_mtime, st_ctime): Define as macros. (_GL_WINDOWS_STAT_TIMESPEC): New macro. * lib/stat-w32.h (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New declaration. * lib/stat-w32.c (_gl_convert_FILETIME_to_timespec) [_GL_WINDOWS_STAT_TIMESPEC]: New function. (_gl_convert_FILETIME_to_POSIX): Adjust coding style. (_gl_fstat_by_handle): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat.c (rpl_stat): If _GL_WINDOWS_STAT_TIMESPEC, convert the FILETIME to 'struct timespec', not 'time_t'. * lib/stat-time.h (STAT_TIMESPEC): Define also if _GL_WINDOWS_STAT_TIMESPEC. * doc/windows-stat-timespec.texi: New file. * doc/gnulib.texi: Include it.
* windows-stat-override: New module.Bruno Haible2017-05-131-1/+2
| | | | | | | | | | | | | | | * lib/sys_stat.in.h (stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provide own definition. Define GNULIB_defined_struct_stat. (fstat, fstatat, lstat, stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provoke link error if this symbol is used and the corresponding module is not in use. (_stat64, _stat32i64, _stati64, _stat32, _stat64i32): Don't redefine if GNULIB_OVERRIDES_STRUCT_STAT. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_OVERRIDES_STRUCT_STAT. * modules/sys_stat (Makefile.am): Substitute GNULIB_OVERRIDES_STRUCT_STAT. * modules/windows-stat-override: New file.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* sys_stat: no 'static inline'Paul Eggert2012-11-291-4/+1
| | | | | * lib/sys_stat.in.h (rpl_mkdir): Now static, not static inline. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Do not require AC_C_INLINE.
* sockets, sys_stat: restore AC_C_INLINEPaul Eggert2012-09-301-1/+4
| | | | | | | | | This undoes the 2012-09-22 patch. * m4/sockets.m4 (gl_SOCKETS): * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Restore AC_C_INLINE, since MSVC requires __inline or _inline and does not support plain 'inline'. Reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnulib/2012-09/msg00183.html>.
* sockets, sys_stat: remove AC_C_INLINE in MSVC-only casesPaul Eggert2012-09-221-4/+1
| | | | | | | | * m4/sockets.m4 (gl_SOCKETS): * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Remove AC_C_INLINE. Here, 'inline' is used only in MSVC environments where it's already guaranteed to work, so we needn't check for it at 'configure'-time.
* Large File Support for native Windows platforms.Bruno Haible2012-04-211-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/largefile.m4 (gl_LARGEFILE): New macro. * modules/largefile (configure.ac): Require gl_LARGEFILE. * lib/sys_types.in.h (off_t) [WINDOWS_64_BIT_OFF_T]: Define to a 64-bit type. * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_64_BIT_OFF_T. * modules/sys_types (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T. * doc/posix-headers/sys_types.texi: Mention the effect of the 'largefile' module. * lib/fcntl.in.h: Add comments about off_t. * modules/fcntl-h (Depends-on): Add sys_types. * lib/unistd.in.h [WINDOWS_64_BIT_OFF_T]: Include <sys/types.h>. (ftruncate): Replace it if REPLACE_FTRUNCATE is 1. * m4/unistd_h.m4 (gl_UNISTD_H): Require gl_SYS_TYPES_H. (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_FTRUNCATE. * modules/unistd (Depends-on): Add sys_types. (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T, REPLACE_FTRUNCATE. * lib/lseek.c (rpl_lseek) [_GL_WINDOWS_64_BIT_OFF_T]: Use _lseeki64 instead of lseek. * m4/lseek.m4 (gl_FUNC_LSEEK): Require gl_SYS_TYPES_H. Set REPLACE_LSEEK if WINDOWS_64_BIT_OFF_T is 1. * modules/lseek (Depends-on): Add sys_types. * lib/ftruncate.c: Put under GPLv3+. Include <windows.h>, msvc-nothrow.h. (SetFileSize): New function. (ftruncate) [_GL_WINDOWS_64_BIT_OFF_T]: New implementation. * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Set REPLACE_FTRUNCATE on Windows if Large File Support is requested. * modules/ftruncate (configure.ac): Consider REPLACE_FTRUNCATE. (Depends-on): Add sys_types, msvc-nothrow. Update conditions. * lib/stdio.in.h: Add comments about off_t. * modules/stdio (Depends-on): Add sys_types. * lib/ftello.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _ftelli64 or ftello64 instead of ftello. * m4/ftello.m4 (gl_FUNC_FTELLO): Require gl_SYS_TYPES_H. Set REPLACE_FTELLO if WINDOWS_64_BIT_OFF_T is 1. (gl_PREREQ_FTELLO): New macro. * modules/ftello (Depends-on): Add sys_types. (configure.ac): Incoke gl_PREREQ_FTELLO. * lib/fseeko.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _fseeki64 or fseeko64 instead of fseeko. * m4/fseeko.m4 (gl_FUNC_FSEEKO): Require gl_SYS_TYPES_H. Set REPLACE_FSEEKO if WINDOWS_64_BIT_OFF_T is 1. (gl_PREREQ_FSEEKO): New macro. * modules/fseeko (Depends-on): Add sys_types. (configure.ac): Invoke gl_PREREQ_FSEEKO. * lib/sys_stat.in.h: Add comments about off_t. (stat, fstat) [WINDOWS_64_BIT_ST_SIZE]: Define to variants that use a 64-bit integer for st_size in 'struct stat'. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_64_BIT_ST_SIZE. Define _GL_WINDOWS_64_BIT_ST_SIZE. * modules/sys_stat (Depends-on): Add sys_types. (Makefile.am): Substitute WINDOWS_64_BIT_ST_SIZE. * lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Define to _stati64 instead of stat or _stat. * lib/fstat.c [_GL_WINDOWS_64_BIT_ST_SIZE]: Use _fstati64 and 'struct _stati64' instead of fstat and 'struct stat'. * m4/fstat.m4 (gl_FUNC_FSTAT): Require gl_HEADER_SYS_STAT_H. Set REPLACE_FSTAT if WINDOWS_64_BIT_ST_SIZE is 1. Reported by Ray Satiro <raysatiro@yahoo.com>.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* New module 'fstat'.Bruno Haible2011-09-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/sys_stat.in.h (fstat): Declare only if GNULIB_FSTAT is set. * lib/fstat.c: New file, based on a piece of lib/fchdir.c. * lib/fchdir.c (rpl_fstat): Remove function. * m4/fstat.m4: New file. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_FSTAT. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Test whether fstat is declared. (gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_FSTAT. * modules/sys_stat (Makefile.am): Substitute GNULIB_FSTAT. * modules/fstat: New file. * modules/sys_stat-tests (Depends-on): Remove fstat-tests. * tests/test-sys_stat-c++.cc (fstat): Check only if GNULIB_TEST_FSTAT is set. * doc/posix-functions/fstat.texi: Mention the new module and the problem on MSVC. * NEWS: Mention the change. * modules/acl (Depends-on): Add fstat. * modules/chdir-safer (Depends-on): Likewise. * modules/chown (Depends-on): Likewise. * modules/copy-file (Depends-on): Likewise. * modules/fchdir (Depends-on): Likewise. * modules/fdopendir (Depends-on): Likewise. * modules/fopen (Depends-on): Likewise. * modules/fts (Depends-on): Likewise. * modules/getcwd (Depends-on): Likewise. * modules/isapipe (Depends-on): Likewise. * modules/linkat (Depends-on): Likewise. * modules/lseek (Depends-on): Likewise. * modules/mkdir-p (Depends-on): Likewise. * modules/open (Depends-on): Likewise. * modules/openat (Depends-on): Likewise. * modules/read-file (Depends-on): Likewise. * modules/renameat (Depends-on): Likewise. * modules/utimens (Depends-on): Likewise.
* Support for MSVC compiler: Ensure mode_t gets defined.Bruno Haible2011-09-161-1/+4
| | | | | | | | | | | | | * m4/fcntl_h.m4 (gl_FCNTL_H): Require AC_TYPE_MODE_T. * m4/spawn_h.m4 (gl_SPAWN_H): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Likewise. * tests/test-fcntl-h.c: Check that mode_t is defined. * tests/test-sys_stat.c: Likewise. * tests/test-sys_types.c: Likewise. * doc/posix-headers/fcntl.texi: Mention the missing mode_t problem. * doc/posix-headers/sys_stat.texi: Likewise. * doc/posix-headers/sys_types.texi: Likewise.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* Distinguish two kinds of module indicators.Bruno Haible2010-03-281-1/+1
|
* Factorize common .m4 code.Bruno Haible2010-03-271-2/+2
|
* Tests of module 'sys_stat' in C++ mode.Bruno Haible2010-03-081-1/+3
|
* warn-on-use: use instead of link-warningEric Blake2010-01-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each *.in.h file serves two purposes - provide enough self-contained content to serve as a replacement for the system header regardless of the user's compiler, and offer the developer the ability to detect any gnulib modules that might have been inadvertantly excluded. The former requires independence from config.h, and routes everything through a Makefile.am snippet that uses @@ substitution specific to the modules that were in use, with details learned at configure time. The latter works by poisoning anything that gnulib did not replace, but which the developer had natively available, explaining why their tests passed during development. Poisoning relies on gcc features, and requires manual triggering by adding -DGNULIB_POSIXCHECK to CFLAGS; it assumes that <config.h> is properly included. In fact, we do not want to use @@ substitution for HAVE_DECL_* during poisoning, because the warning is only relevant for the gnulib modules which were not included, and thus where the m4 macros to set proper @@ values have not been run. Furthermore, we only need to poison interfaces that already have a declaration; if something is not declared, then the developer wouldn't have been able to link, so their code won't be using the problematic interface in the first place. * modules/stdio (Depends-on, Makefile.am): Drop link-warning. * modules/unistd (Depends-on, Makefile.am): Likewise. * modules/arpa_inet (Depends-on): Replace link-warning with warn-on-use. (Makefile.am): Update rules accordingly. * modules/ctype (Depends-on, Makefile.am): Likewise. * modules/dirent (Depends-on, Makefile.am): Likewise. * modules/fcntl-h (Depends-on, Makefile.am): Likewise. * modules/inttypes (Depends-on, Makefile.am): Likewise. * modules/langinfo (Depends-on, Makefile.am): Likewise. * modules/locale (Depends-on, Makefile.am): Likewise. * modules/math (Depends-on, Makefile.am): Likewise. * modules/search (Depends-on, Makefile.am): Likewise. * modules/signal (Depends-on, Makefile.am): Likewise. * modules/spawn (Depends-on, Makefile.am): Likewise. * modules/stdlib (Depends-on, Makefile.am): Likewise. * modules/string (Depends-on, Makefile.am): Likewise. * modules/strings (Depends-on, Makefile.am): Likewise. * modules/sys_file (Depends-on, Makefile.am): Likewise. * modules/sys_ioctl (Depends-on, Makefile.am): Likewise. * modules/sys_select (Depends-on, Makefile.am): Likewise. * modules/sys_socket (Depends-on, Makefile.am): Likewise. * modules/sys_stat (Depends-on, Makefile.am): Likewise. * modules/sys_times (Depends-on, Makefile.am): Likewise. * modules/sys_utsname (Depends-on, Makefile.am): Likewise. * modules/wchar (Depends-on, Makefile.am): Likewise. * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Check which functions should be poisoned. * m4/ctype.m4 (gl_CTYPE_H): Likewise. * m4/dirent_h.m4 (gl_DIRENT_H): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H): Likewise. * m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise. * m4/locale_h.m4 (gl_LOCALE_H): Likewise. * m4/math_h.m4 (gl_MATH_H): Likewise. * m4/search_h.m4 (gl_SEARCH_H): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Likewise. * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H_DEFAULTS): Likewise. * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise. * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise. * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise. * m4/wchar.m4 (gl_WCHAR_H): Likewise. * lib/arpa_inet.in.h: Use _GL_WARN_ON_USE instead of GL_LINK_WARNING. * lib/ctype.in.h: Likewise. * lib/dirent.in.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/inttypes.in.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/math.in.h: Likewise. * lib/search.in.h: Likewise. * lib/signal.in.h: Likewise. * lib/spawn.in.h: Likewise. * lib/stdio.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/string.in.h: Likewise. * lib/strings.in.h: Likewise. * lib/sys_file.in.h: Likewise. * lib/sys_ioctl.in.h: Likewise. * lib/sys_select.in.h: Likewise. * lib/sys_socket.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/wchar.in.h: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* mknod: new moduleEric Blake2009-11-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Solaris 9 mknod("name/",mode,dev) mistakenly creates "name" for non-directory mode. FreeBSD 7.2 mknod("dangling/",mode,dev) mistakenly creates the target of the symlink if run as root. FreeBSD and OpenBSD mknod("fifo",S_IFIFO|mode,0) fails for non-root. Use of mknod caused link failures on mingw. * modules/mknod: New file. * m4/mknod.m4 (gl_FUNC_MKNOD): Likewise. * lib/mknod.c (mknod): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Set witness defaults. * modules/sys_stat (Makefile.am): Substitute them. * lib/sys_stat.in.h (mknod): Declare replacement. * MODULES.html.sh (Support for systems lacking POSIX:2008): Document it. * doc/posix-functions/mknod.texi (mknod): Likewise. * modules/mknod-tests: New test. * tests/test-mknod.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* mkfifo: new moduleEric Blake2009-11-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Solaris 9 mkfifo("name/",mode) mistakenly creates "name". FreeBSD 7.2 mkfifo("dangling/",mode) mistakenly creates a fifo at the target of "dangling". Mingw lacks named pipes altogether, but this at least avoids link failures. * modules/mkfifo: New file. * m4/mkfifo.m4 (gl_FUNC_MKFIFO): Likewise. * lib/mkfifo.c (mkfifo): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Set witness defaults. * modules/sys_stat (Makefile.am): Substitute them. * lib/sys_stat.in.h (mkfifo): Declare replacement. * MODULES.html.sh (Support for systems lacking POSIX:2008): Document it. * doc/posix-functions/mkfifo.texi (mkfifo): Likewise. * modules/mkfifo-tests: New test. * tests/test-mkfifo.h (test_mkfifo): New file, borrowed in part from test-mkfifoat.c. * tests/test-mkfifo.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>
* utimensat: new moduleEric Blake2009-10-161-24/+27
| | | | | | | | | | | | | | | | | | | | Provide utimensat where it is missing, and rpl_utimensat to work around ENOSYS and EINVAL bugs in older Linux kernels. * modules/utimensat: New file. * lib/utimensat.c (utimensat): Likewise. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise. * lib/utimens.c (utimensat): Avoid recursion into rpl_utimensat, so we can work around Linux bugs. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses. * modules/sys_stat (Makefile.am): Substitute them. * lib/sys_stat.in.h (utimensat): Declare it. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/utimensat.texi (utimensat): Likewise. * modules/utimensat-tests: New test. * tests/test-utimensat.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* futimens: new moduleEric Blake2009-10-101-1/+4
| | | | | | | | | | | | | | | | | | | | Provides futimens where it is missing, and rpl_futimens to work around bugs in older Linux kernels. * modules/futimens: New file. * lib/futimens.c (futimens): Likewise. * m4/futimens.m4 (gl_FUNC_FUTIMENS): Likewise. * lib/utimens.c (futimens): Avoid recursion into rpl_futimens, so we can work around Linux bugs. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses. * modules/sys_stat (Makefile.am): Substitute them. * lib/sys_stat.in.h (futimens): Declare it. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/futimens.texi (futimens): Likewise. * modules/futimens-tests: New test. * tests/test-futimens.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* lstat: avoid mingw compilation errorEric Blake2009-09-231-11/+2
| | | | | | | | | | | | | | | | | | | The openat module required lstat, but then repeated the checks for whether lstat worked. When cross-compiling to mingw, this led to a wrong answer and tried compiling lstat.c, even though it was not necessary, with a result of a compiler warning about undeclared lstat. * m4/lstat.m4 (gl_FUNC_LSTAT): Avoid duplicate calls to AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, and deal with missing lstat ourselves. * lib/lstat.c [!HAVE_LSTAT]: Do nothing if <sys/stat.h> override was adequate. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Let lstat module handle the checks for lstat. (gl_SYS_STAT_H_DEFAULTS): Set default for HAVE_LSTAT. Signed-off-by: Eric Blake <ebb9@byu.net>
* stat: new module, for mingw bugEric Blake2009-09-191-1/+3
| | | | | | | | | | | | | | | | | | | | | Depending on the current directory, either stat(".",buf) or stat("./",buf) would fail on mingw. * modules/stat: New file. * lib/stat.c: Likewise. * m4/stat.m4 (gl_FUNC_STAT): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses. * modules/sys_stat (Makefile.am): Use them. * lib/sys_stat.in.h (stat): Declare replacement. * lib/openat.c (fstatat): Deal with lstat and stat being function macros. * modules/openat (Depends-on): Add inline. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/stat.texi (stat): Likewise. * modules/stat-tests: New test. * tests/test-stat.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* fchdir: improve use of replacement functionsEric Blake2009-09-151-1/+2
| | | | | | | | | | | | | | | | * m4/fchdir.m4 (gl_FUNC_FCHDIR): Set appropriate witnesses. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add REPLACE_FSTAT. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add REPLACE_OPENDIR, REPLACE_CLOSEDIR. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_DUP. * modules/sys_stat (Makefile.am): Substitute correct witness. * modules/dirent (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * lib/dirent.in.h (opendir, closedir): Use better witnesses. * lib/unistd.in.h (dup): Likewise. * lib/sys_stat.in.h (fstat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* mkfifoat: new moduleEric Blake2009-09-081-14/+18
| | | | | | | | | | | | | | | | * modules/mkfifoat: New file. * lib/mkfifoat.c: Likewise. * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add witnesses. * modules/sys_stat (Makefile.am): Use them. * lib/sys_stat.in.h (mkfifoat, mknodat): Declare them. * MODULES.html.sh (File system functions): Mention module. * doc/posix-functions/mkfifoat.texi (mkfifoat): Likewise. * doc/posix-functions/mknodat.texi (mknodat): Likewise. * modules/mkfifoat-tests: New test. * tests/test-mkfifoat.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.Bruno Haible2009-09-071-7/+13
|
* openat: declare in POSIX headersEric Blake2009-09-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention this. * modules/openat (configure.ac): Declare witnesses. (Depends-on): Add fcntl-h, sys_stat, unistd. (Include): Mention correct headers. * modules/fcntl-h (Depends-on): Add link-warning. (Files): Add openat.m4. (Makefile.am): Substitute witnesses. * modules/sys_stat (Files, Makefile.am): Likewise. * modules/unistd (Files, Makefile.am): Likewise. * m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses. (gl_OPENAT_DEFAULTS): New macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. (SYS_STAT_H): Remove unused variable. * doc/posix-headers/fcntl.texi (fcntl.h): Update content. * lib/fcntl--.h (includes): Remove unneeded header. * lib/openat-safer.c (includes): Likewise. * lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to appropriate headers. (__OPENAT_PREFIX): Delete. * lib/fcntl.in.h (openat): Provide declaration. (AT_FDCWD): Fix Solaris bug. (AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros. * lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration. * lib/fchmodat.c (includes): Adjust to find declaration. * lib/fchownat.c (includes): Likewise. * lib/mkdirat.c (includes): Likewise. * lib/fstatat.c (includes): Likewise. Ensure original fstatat is still visible. Signed-off-by: Eric Blake <ebb9@byu.net>
* fchdir: use more consistent macro conventionEric Blake2009-09-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | * lib/fcntl.in.h (_gl_register_fd): Move declaration to unistd. * lib/sys_stat.in.h (rpl_fstat): Declare via make-time REPLACE_FCHDIR, rather than relying on config.h macros. * lib/unistd.in.h (fchdir): Move all fchdir internal declarations inside a single make-time REPLACE_FCHDIR block, rather than using the config.h FCHDIR_REPLACEMENT. * m4/fchdir.m4 (gl_FUNC_FCHDIR): REPLACE_FCHDIR was already AC_SUBST'd, also AC_DEFINE it. Don't define FCHDIR_REPLACEMENT. Manage fstat replacement. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Pick up REPLACE_FCHDIR. * modules/sys_stat (Files): Add m4/unistd_h.m4. (Makefile.am): Substitute REPLACE_FCHDIR. * lib/close.c (rpl_close): Use REPLACE_FCHDIR, not FCHDIR_REPLACEMENT. * lib/dup-safer.c (dup_safer): Likewise. * lib/dup2.c (rpl_dup2): Likewise. * lib/dup3.c (rpl_dup3): Likewise. * lib/open.c (rpl_open): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Move the lstat() declaration to <sys/stat.h>.Bruno Haible2008-10-211-1/+3
|
* Move the lchmod() declaration to <sys/stat.h>.Bruno Haible2008-10-191-1/+3
|
* Fix compilation errors related to rpl_mkdir on mingw.Bruno Haible2008-04-211-19/+17
|