aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2011-02-21 09:56:37 -0800
committerPaul Eggert2011-02-21 09:56:37 -0800
commit5c185672d66dc89bfd2c7889a5f0a6984c0ec607 (patch)
tree0c3f95cac8c6d7258525c1e47db22f49e9d311f1 /lib
parent06b840e0d96538cfa879eb524c9b030988f8e7c5 (diff)
parent2763cfc26857991fc4ccde9ff837c06032ac1008 (diff)
downloademacs-5c185672d66dc89bfd2c7889a5f0a6984c0ec607.tar.gz
emacs-5c185672d66dc89bfd2c7889a5f0a6984c0ec607.zip
Import filemode module from gnulib.
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/Makefile.in120
-rw-r--r--lib/filemode.c180
-rw-r--r--lib/filemode.h44
-rw-r--r--lib/gnulib.mk70
-rw-r--r--lib/sys_stat.in.h646
6 files changed, 1044 insertions, 17 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6a014f6057b..220ba713d4e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,6 @@
1BUILT_SOURCES = 1BUILT_SOURCES =
2EXTRA_DIST = 2EXTRA_DIST =
3MOSTLYCLEANDIRS =
3MOSTLYCLEANFILES = 4MOSTLYCLEANFILES =
4noinst_LIBRARIES = 5noinst_LIBRARIES =
5 6
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 0029719373a..b16587bbddc 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -24,7 +24,7 @@
24# the same distribution terms as the rest of that program. 24# the same distribution terms as the rest of that program.
25# 25#
26# Generated by gnulib-tool. 26# Generated by gnulib-tool.
27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr getloadavg getopt-gnu ignore-value mktime strftime 27# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value mktime strftime
28 28
29VPATH = @srcdir@ 29VPATH = @srcdir@
30pkgdatadir = $(datadir)/@PACKAGE@ 30pkgdatadir = $(datadir)/@PACKAGE@
@@ -51,13 +51,15 @@ subdir = lib
51ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 51ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
52am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ 52am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
53 $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/extensions.m4 \ 53 $(top_srcdir)/m4/c-strtod.m4 $(top_srcdir)/m4/extensions.m4 \
54 $(top_srcdir)/m4/getloadavg.m4 $(top_srcdir)/m4/getopt.m4 \ 54 $(top_srcdir)/m4/filemode.m4 $(top_srcdir)/m4/getloadavg.m4 \
55 $(top_srcdir)/m4/gl-comp.m4 $(top_srcdir)/m4/gnulib-common.m4 \ 55 $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gl-comp.m4 \
56 $(top_srcdir)/m4/gnulib-common.m4 \
56 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/longlong.m4 \ 57 $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/longlong.m4 \
57 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \ 58 $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/mktime.m4 \
58 $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/stdbool.m4 \ 59 $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/st_dm_mode.m4 \
59 $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ 60 $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
60 $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strftime.m4 \ 61 $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdlib_h.m4 \
62 $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
61 $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \ 63 $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/time_r.m4 \
62 $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \ 64 $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/unistd_h.m4 \
63 $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in 65 $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/configure.in
@@ -152,9 +154,12 @@ GNULIB_ENVIRON = @GNULIB_ENVIRON@
152GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ 154GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
153GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ 155GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
154GNULIB_FCHDIR = @GNULIB_FCHDIR@ 156GNULIB_FCHDIR = @GNULIB_FCHDIR@
157GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
155GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ 158GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
159GNULIB_FSTATAT = @GNULIB_FSTATAT@
156GNULIB_FSYNC = @GNULIB_FSYNC@ 160GNULIB_FSYNC = @GNULIB_FSYNC@
157GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ 161GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
162GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
158GNULIB_GETCWD = @GNULIB_GETCWD@ 163GNULIB_GETCWD = @GNULIB_GETCWD@
159GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ 164GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
160GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ 165GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
@@ -167,12 +172,19 @@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
167GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ 172GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
168GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ 173GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
169GNULIB_GRANTPT = @GNULIB_GRANTPT@ 174GNULIB_GRANTPT = @GNULIB_GRANTPT@
175GNULIB_LCHMOD = @GNULIB_LCHMOD@
170GNULIB_LCHOWN = @GNULIB_LCHOWN@ 176GNULIB_LCHOWN = @GNULIB_LCHOWN@
171GNULIB_LINK = @GNULIB_LINK@ 177GNULIB_LINK = @GNULIB_LINK@
172GNULIB_LINKAT = @GNULIB_LINKAT@ 178GNULIB_LINKAT = @GNULIB_LINKAT@
173GNULIB_LSEEK = @GNULIB_LSEEK@ 179GNULIB_LSEEK = @GNULIB_LSEEK@
180GNULIB_LSTAT = @GNULIB_LSTAT@
174GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ 181GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
182GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
175GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ 183GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
184GNULIB_MKFIFO = @GNULIB_MKFIFO@
185GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
186GNULIB_MKNOD = @GNULIB_MKNOD@
187GNULIB_MKNODAT = @GNULIB_MKNODAT@
176GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ 188GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
177GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ 189GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
178GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ 190GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
@@ -194,6 +206,7 @@ GNULIB_RMDIR = @GNULIB_RMDIR@
194GNULIB_RPMATCH = @GNULIB_RPMATCH@ 206GNULIB_RPMATCH = @GNULIB_RPMATCH@
195GNULIB_SETENV = @GNULIB_SETENV@ 207GNULIB_SETENV = @GNULIB_SETENV@
196GNULIB_SLEEP = @GNULIB_SLEEP@ 208GNULIB_SLEEP = @GNULIB_SLEEP@
209GNULIB_STAT = @GNULIB_STAT@
197GNULIB_STRPTIME = @GNULIB_STRPTIME@ 210GNULIB_STRPTIME = @GNULIB_STRPTIME@
198GNULIB_STRTOD = @GNULIB_STRTOD@ 211GNULIB_STRTOD = @GNULIB_STRTOD@
199GNULIB_STRTOLL = @GNULIB_STRTOLL@ 212GNULIB_STRTOLL = @GNULIB_STRTOLL@
@@ -211,6 +224,7 @@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
211GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ 224GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
212GNULIB_UNSETENV = @GNULIB_UNSETENV@ 225GNULIB_UNSETENV = @GNULIB_UNSETENV@
213GNULIB_USLEEP = @GNULIB_USLEEP@ 226GNULIB_USLEEP = @GNULIB_USLEEP@
227GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
214GNULIB_WRITE = @GNULIB_WRITE@ 228GNULIB_WRITE = @GNULIB_WRITE@
215GNULIB__EXIT = @GNULIB__EXIT@ 229GNULIB__EXIT = @GNULIB__EXIT@
216GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@ 230GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@
@@ -239,9 +253,12 @@ HAVE_DUP3 = @HAVE_DUP3@
239HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ 253HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
240HAVE_FACCESSAT = @HAVE_FACCESSAT@ 254HAVE_FACCESSAT = @HAVE_FACCESSAT@
241HAVE_FCHDIR = @HAVE_FCHDIR@ 255HAVE_FCHDIR = @HAVE_FCHDIR@
256HAVE_FCHMODAT = @HAVE_FCHMODAT@
242HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ 257HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
258HAVE_FSTATAT = @HAVE_FSTATAT@
243HAVE_FSYNC = @HAVE_FSYNC@ 259HAVE_FSYNC = @HAVE_FSYNC@
244HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ 260HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
261HAVE_FUTIMENS = @HAVE_FUTIMENS@
245HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ 262HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
246HAVE_GETGROUPS = @HAVE_GETGROUPS@ 263HAVE_GETGROUPS = @HAVE_GETGROUPS@
247HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ 264HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
@@ -251,12 +268,19 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
251HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ 268HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
252HAVE_GRANTPT = @HAVE_GRANTPT@ 269HAVE_GRANTPT = @HAVE_GRANTPT@
253HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ 270HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
271HAVE_LCHMOD = @HAVE_LCHMOD@
254HAVE_LCHOWN = @HAVE_LCHOWN@ 272HAVE_LCHOWN = @HAVE_LCHOWN@
255HAVE_LINK = @HAVE_LINK@ 273HAVE_LINK = @HAVE_LINK@
256HAVE_LINKAT = @HAVE_LINKAT@ 274HAVE_LINKAT = @HAVE_LINKAT@
257HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ 275HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
276HAVE_LSTAT = @HAVE_LSTAT@
258HAVE_MAKEINFO = @HAVE_MAKEINFO@ 277HAVE_MAKEINFO = @HAVE_MAKEINFO@
278HAVE_MKDIRAT = @HAVE_MKDIRAT@
259HAVE_MKDTEMP = @HAVE_MKDTEMP@ 279HAVE_MKDTEMP = @HAVE_MKDTEMP@
280HAVE_MKFIFO = @HAVE_MKFIFO@
281HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
282HAVE_MKNOD = @HAVE_MKNOD@
283HAVE_MKNODAT = @HAVE_MKNODAT@
260HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ 284HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
261HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ 285HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
262HAVE_MKSTEMP = @HAVE_MKSTEMP@ 286HAVE_MKSTEMP = @HAVE_MKSTEMP@
@@ -298,6 +322,7 @@ HAVE_UNLINKAT = @HAVE_UNLINKAT@
298HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ 322HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
299HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ 323HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
300HAVE_USLEEP = @HAVE_USLEEP@ 324HAVE_USLEEP = @HAVE_USLEEP@
325HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
301HAVE_WCHAR_H = @HAVE_WCHAR_H@ 326HAVE_WCHAR_H = @HAVE_WCHAR_H@
302HAVE_WCHAR_T = @HAVE_WCHAR_T@ 327HAVE_WCHAR_T = @HAVE_WCHAR_T@
303HAVE_XSERVER = @HAVE_XSERVER@ 328HAVE_XSERVER = @HAVE_XSERVER@
@@ -369,12 +394,14 @@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
369NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ 394NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
370NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ 395NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
371NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ 396NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
397NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
372NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ 398NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
373NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ 399NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
374NEXT_GETOPT_H = @NEXT_GETOPT_H@ 400NEXT_GETOPT_H = @NEXT_GETOPT_H@
375NEXT_STDDEF_H = @NEXT_STDDEF_H@ 401NEXT_STDDEF_H = @NEXT_STDDEF_H@
376NEXT_STDINT_H = @NEXT_STDINT_H@ 402NEXT_STDINT_H = @NEXT_STDINT_H@
377NEXT_STDLIB_H = @NEXT_STDLIB_H@ 403NEXT_STDLIB_H = @NEXT_STDLIB_H@
404NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
378NEXT_TIME_H = @NEXT_TIME_H@ 405NEXT_TIME_H = @NEXT_TIME_H@
379NEXT_UNISTD_H = @NEXT_UNISTD_H@ 406NEXT_UNISTD_H = @NEXT_UNISTD_H@
380NS_OBJ = @NS_OBJ@ 407NS_OBJ = @NS_OBJ@
@@ -410,6 +437,9 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
410REPLACE_DUP = @REPLACE_DUP@ 437REPLACE_DUP = @REPLACE_DUP@
411REPLACE_DUP2 = @REPLACE_DUP2@ 438REPLACE_DUP2 = @REPLACE_DUP2@
412REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ 439REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
440REPLACE_FSTAT = @REPLACE_FSTAT@
441REPLACE_FSTATAT = @REPLACE_FSTATAT@
442REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
413REPLACE_GETCWD = @REPLACE_GETCWD@ 443REPLACE_GETCWD = @REPLACE_GETCWD@
414REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ 444REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
415REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ 445REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
@@ -420,7 +450,11 @@ REPLACE_LINK = @REPLACE_LINK@
420REPLACE_LINKAT = @REPLACE_LINKAT@ 450REPLACE_LINKAT = @REPLACE_LINKAT@
421REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ 451REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
422REPLACE_LSEEK = @REPLACE_LSEEK@ 452REPLACE_LSEEK = @REPLACE_LSEEK@
453REPLACE_LSTAT = @REPLACE_LSTAT@
423REPLACE_MALLOC = @REPLACE_MALLOC@ 454REPLACE_MALLOC = @REPLACE_MALLOC@
455REPLACE_MKDIR = @REPLACE_MKDIR@
456REPLACE_MKFIFO = @REPLACE_MKFIFO@
457REPLACE_MKNOD = @REPLACE_MKNOD@
424REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ 458REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
425REPLACE_MKTIME = @REPLACE_MKTIME@ 459REPLACE_MKTIME = @REPLACE_MKTIME@
426REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ 460REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
@@ -434,6 +468,7 @@ REPLACE_REALPATH = @REPLACE_REALPATH@
434REPLACE_RMDIR = @REPLACE_RMDIR@ 468REPLACE_RMDIR = @REPLACE_RMDIR@
435REPLACE_SETENV = @REPLACE_SETENV@ 469REPLACE_SETENV = @REPLACE_SETENV@
436REPLACE_SLEEP = @REPLACE_SLEEP@ 470REPLACE_SLEEP = @REPLACE_SLEEP@
471REPLACE_STAT = @REPLACE_STAT@
437REPLACE_STRTOD = @REPLACE_STRTOD@ 472REPLACE_STRTOD = @REPLACE_STRTOD@
438REPLACE_SYMLINK = @REPLACE_SYMLINK@ 473REPLACE_SYMLINK = @REPLACE_SYMLINK@
439REPLACE_TIMEGM = @REPLACE_TIMEGM@ 474REPLACE_TIMEGM = @REPLACE_TIMEGM@
@@ -442,6 +477,7 @@ REPLACE_UNLINK = @REPLACE_UNLINK@
442REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ 477REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
443REPLACE_UNSETENV = @REPLACE_UNSETENV@ 478REPLACE_UNSETENV = @REPLACE_UNSETENV@
444REPLACE_USLEEP = @REPLACE_USLEEP@ 479REPLACE_USLEEP = @REPLACE_USLEEP@
480REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
445REPLACE_WRITE = @REPLACE_WRITE@ 481REPLACE_WRITE = @REPLACE_WRITE@
446RSVG_CFLAGS = @RSVG_CFLAGS@ 482RSVG_CFLAGS = @RSVG_CFLAGS@
447RSVG_LIBS = @RSVG_LIBS@ 483RSVG_LIBS = @RSVG_LIBS@
@@ -559,25 +595,27 @@ x_default_search_path = @x_default_search_path@
559# present in all Makefile.am that need it. This is ensured by the applicability 595# present in all Makefile.am that need it. This is ensured by the applicability
560# 'all' defined above. 596# 'all' defined above.
561BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) $(STDBOOL_H) \ 597BUILT_SOURCES = arg-nonnull.h c++defs.h $(GETOPT_H) $(STDBOOL_H) \
562 $(STDDEF_H) $(STDINT_H) stdlib.h time.h unistd.h warn-on-use.h 598 $(STDDEF_H) $(STDINT_H) stdlib.h sys/stat.h time.h unistd.h \
599 warn-on-use.h
563EXTRA_DIST = $(top_srcdir)/./arg-nonnull.h $(top_srcdir)/./c++defs.h \ 600EXTRA_DIST = $(top_srcdir)/./arg-nonnull.h $(top_srcdir)/./c++defs.h \
564 md5.c md5.h ftoastr.c ftoastr.h getloadavg.c getopt.c \ 601 md5.c md5.h ftoastr.c ftoastr.h filemode.c filemode.h \
565 getopt.in.h getopt1.c getopt_int.h intprops.h \ 602 getloadavg.c getopt.c getopt.in.h getopt1.c getopt_int.h \
566 mktime-internal.h mktime.c stdbool.in.h stddef.in.h \ 603 intprops.h mktime-internal.h mktime.c stdbool.in.h stddef.in.h \
567 stdint.in.h stdlib.in.h strftime.c strftime.h time.in.h \ 604 stdint.in.h stdlib.in.h strftime.c strftime.h sys_stat.in.h \
568 time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h 605 time.in.h time_r.c unistd.in.h $(top_srcdir)/./warn-on-use.h
606MOSTLYCLEANDIRS = sys
569MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \ 607MOSTLYCLEANFILES = core *.stackdump arg-nonnull.h arg-nonnull.h-t \
570 c++defs.h c++defs.h-t getopt.h getopt.h-t stdbool.h \ 608 c++defs.h c++defs.h-t getopt.h getopt.h-t stdbool.h \
571 stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdlib.h \ 609 stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdlib.h \
572 stdlib.h-t time.h time.h-t unistd.h unistd.h-t warn-on-use.h \ 610 stdlib.h-t sys/stat.h sys/stat.h-t time.h time.h-t unistd.h \
573 warn-on-use.h-t 611 unistd.h-t warn-on-use.h warn-on-use.h-t
574noinst_LIBRARIES = libgnu.a 612noinst_LIBRARIES = libgnu.a
575DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src 613DEFAULT_INCLUDES = -I. -I../src -I$(top_srcdir)/src
576libgnu_a_SOURCES = dtoastr.c gettext.h ignore-value.h 614libgnu_a_SOURCES = dtoastr.c gettext.h ignore-value.h
577libgnu_a_LIBADD = $(gl_LIBOBJS) 615libgnu_a_LIBADD = $(gl_LIBOBJS)
578libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) 616libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
579EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c getloadavg.c getopt.c \ 617EXTRA_libgnu_a_SOURCES = md5.c ftoastr.c filemode.c getloadavg.c \
580 getopt1.c mktime.c strftime.c time_r.c 618 getopt.c getopt1.c mktime.c strftime.c time_r.c
581ARG_NONNULL_H = arg-nonnull.h 619ARG_NONNULL_H = arg-nonnull.h
582CXXDEFS_H = c++defs.h 620CXXDEFS_H = c++defs.h
583WARN_ON_USE_H = warn-on-use.h 621WARN_ON_USE_H = warn-on-use.h
@@ -631,6 +669,7 @@ distclean-compile:
631 -rm -f *.tab.c 669 -rm -f *.tab.c
632 670
633@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@ 671@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtoastr.Po@am__quote@
672@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemode.Po@am__quote@
634@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@ 673@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftoastr.Po@am__quote@
635@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@ 674@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getloadavg.Po@am__quote@
636@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ 675@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@@ -1021,6 +1060,55 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
1021 } > $@-t && \ 1060 } > $@-t && \
1022 mv $@-t $@ 1061 mv $@-t $@
1023 1062
1063# We need the following in order to create <sys/stat.h> when the system
1064# has one that is incomplete.
1065sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
1066 $(AM_V_at)$(MKDIR_P) sys
1067 $(AM_V_GEN)rm -f $@-t $@ && \
1068 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1069 sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1070 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1071 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
1072 -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
1073 -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
1074 -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
1075 -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
1076 -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
1077 -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
1078 -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
1079 -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
1080 -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
1081 -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
1082 -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
1083 -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
1084 -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
1085 -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
1086 -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
1087 -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
1088 -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
1089 -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
1090 -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
1091 -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
1092 -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
1093 -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
1094 -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
1095 -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
1096 -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
1097 -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
1098 -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
1099 -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
1100 -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
1101 -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
1102 -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
1103 -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
1104 -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
1105 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
1106 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
1107 -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
1108 < $(srcdir)/sys_stat.in.h; \
1109 } > $@-t && \
1110 mv $@-t $@
1111
1024# We need the following in order to create <time.h> when the system 1112# We need the following in order to create <time.h> when the system
1025# doesn't have one that works with the given compiler. 1113# doesn't have one that works with the given compiler.
1026time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) 1114time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
diff --git a/lib/filemode.c b/lib/filemode.c
new file mode 100644
index 00000000000..0f6641ace6a
--- /dev/null
+++ b/lib/filemode.c
@@ -0,0 +1,180 @@
1/* filemode.c -- make a string describing file modes
2
3 Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2011 Free
4 Software Foundation, Inc.
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19#include <config.h>
20
21#include "filemode.h"
22
23/* The following is for Cray DMF (Data Migration Facility), which is a
24 HSM file system. A migrated file has a `st_dm_mode' that is
25 different from the normal `st_mode', so any tests for migrated
26 files should use the former. */
27#if HAVE_ST_DM_MODE
28# define IS_MIGRATED_FILE(statp) \
29 (S_ISOFD (statp->st_dm_mode) || S_ISOFL (statp->st_dm_mode))
30#else
31# define IS_MIGRATED_FILE(statp) 0
32#endif
33
34#if ! HAVE_DECL_STRMODE
35
36/* Return a character indicating the type of file described by
37 file mode BITS:
38 '-' regular file
39 'b' block special file
40 'c' character special file
41 'C' high performance ("contiguous data") file
42 'd' directory
43 'D' door
44 'l' symbolic link
45 'm' multiplexed file (7th edition Unix; obsolete)
46 'n' network special file (HP-UX)
47 'p' fifo (named pipe)
48 'P' port
49 's' socket
50 'w' whiteout (4.4BSD)
51 '?' some other file type */
52
53static char
54ftypelet (mode_t bits)
55{
56 /* These are the most common, so test for them first. */
57 if (S_ISREG (bits))
58 return '-';
59 if (S_ISDIR (bits))
60 return 'd';
61
62 /* Other letters standardized by POSIX 1003.1-2004. */
63 if (S_ISBLK (bits))
64 return 'b';
65 if (S_ISCHR (bits))
66 return 'c';
67 if (S_ISLNK (bits))
68 return 'l';
69 if (S_ISFIFO (bits))
70 return 'p';
71
72 /* Other file types (though not letters) standardized by POSIX. */
73 if (S_ISSOCK (bits))
74 return 's';
75
76 /* Nonstandard file types. */
77 if (S_ISCTG (bits))
78 return 'C';
79 if (S_ISDOOR (bits))
80 return 'D';
81 if (S_ISMPB (bits) || S_ISMPC (bits))
82 return 'm';
83 if (S_ISNWK (bits))
84 return 'n';
85 if (S_ISPORT (bits))
86 return 'P';
87 if (S_ISWHT (bits))
88 return 'w';
89
90 return '?';
91}
92
93/* Like filemodestring, but rely only on MODE. */
94
95void
96strmode (mode_t mode, char *str)
97{
98 str[0] = ftypelet (mode);
99 str[1] = mode & S_IRUSR ? 'r' : '-';
100 str[2] = mode & S_IWUSR ? 'w' : '-';
101 str[3] = (mode & S_ISUID
102 ? (mode & S_IXUSR ? 's' : 'S')
103 : (mode & S_IXUSR ? 'x' : '-'));
104 str[4] = mode & S_IRGRP ? 'r' : '-';
105 str[5] = mode & S_IWGRP ? 'w' : '-';
106 str[6] = (mode & S_ISGID
107 ? (mode & S_IXGRP ? 's' : 'S')
108 : (mode & S_IXGRP ? 'x' : '-'));
109 str[7] = mode & S_IROTH ? 'r' : '-';
110 str[8] = mode & S_IWOTH ? 'w' : '-';
111 str[9] = (mode & S_ISVTX
112 ? (mode & S_IXOTH ? 't' : 'T')
113 : (mode & S_IXOTH ? 'x' : '-'));
114 str[10] = ' ';
115 str[11] = '\0';
116}
117
118#endif /* ! HAVE_DECL_STRMODE */
119
120/* filemodestring - fill in string STR with an ls-style ASCII
121 representation of the st_mode field of file stats block STATP.
122 12 characters are stored in STR.
123 The characters stored in STR are:
124
125 0 File type, as in ftypelet above, except that other letters are used
126 for files whose type cannot be determined solely from st_mode:
127
128 'F' semaphore
129 'M' migrated file (Cray DMF)
130 'Q' message queue
131 'S' shared memory object
132 'T' typed memory object
133
134 1 'r' if the owner may read, '-' otherwise.
135
136 2 'w' if the owner may write, '-' otherwise.
137
138 3 'x' if the owner may execute, 's' if the file is
139 set-user-id, '-' otherwise.
140 'S' if the file is set-user-id, but the execute
141 bit isn't set.
142
143 4 'r' if group members may read, '-' otherwise.
144
145 5 'w' if group members may write, '-' otherwise.
146
147 6 'x' if group members may execute, 's' if the file is
148 set-group-id, '-' otherwise.
149 'S' if it is set-group-id but not executable.
150
151 7 'r' if any user may read, '-' otherwise.
152
153 8 'w' if any user may write, '-' otherwise.
154
155 9 'x' if any user may execute, 't' if the file is "sticky"
156 (will be retained in swap space after execution), '-'
157 otherwise.
158 'T' if the file is sticky but not executable.
159
160 10 ' ' for compatibility with 4.4BSD strmode,
161 since this interface does not support ACLs.
162
163 11 '\0'. */
164
165void
166filemodestring (struct stat const *statp, char *str)
167{
168 strmode (statp->st_mode, str);
169
170 if (S_TYPEISSEM (statp))
171 str[0] = 'F';
172 else if (IS_MIGRATED_FILE (statp))
173 str[0] = 'M';
174 else if (S_TYPEISMQ (statp))
175 str[0] = 'Q';
176 else if (S_TYPEISSHM (statp))
177 str[0] = 'S';
178 else if (S_TYPEISTMO (statp))
179 str[0] = 'T';
180}
diff --git a/lib/filemode.h b/lib/filemode.h
new file mode 100644
index 00000000000..1a50302704c
--- /dev/null
+++ b/lib/filemode.h
@@ -0,0 +1,44 @@
1/* Make a string describing file modes.
2
3 Copyright (C) 1998-1999, 2003, 2006, 2009-2011 Free Software Foundation,
4 Inc.
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19#ifndef FILEMODE_H_
20
21# include <sys/types.h>
22# include <sys/stat.h>
23
24/* Get the declaration of strmode. */
25# if HAVE_DECL_STRMODE
26# include <string.h> /* MacOS X, FreeBSD, OpenBSD */
27# include <unistd.h> /* NetBSD */
28# endif
29
30# ifdef __cplusplus
31extern "C" {
32# endif
33
34# if !HAVE_DECL_STRMODE
35extern void strmode (mode_t mode, char *str);
36# endif
37
38extern void filemodestring (struct stat const *statp, char *str);
39
40# ifdef __cplusplus
41}
42# endif
43
44#endif
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index 3e93e12d9bf..bdba2e9c1bb 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -9,7 +9,7 @@
9# the same distribution terms as the rest of that program. 9# the same distribution terms as the rest of that program.
10# 10#
11# Generated by gnulib-tool. 11# Generated by gnulib-tool.
12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr getloadavg getopt-gnu ignore-value mktime strftime 12# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files crypto/md5 dtoastr filemode getloadavg getopt-gnu ignore-value mktime strftime
13 13
14 14
15MOSTLYCLEANFILES += core *.stackdump 15MOSTLYCLEANFILES += core *.stackdump
@@ -88,6 +88,15 @@ EXTRA_libgnu_a_SOURCES += ftoastr.c
88 88
89## end gnulib module dtoastr 89## end gnulib module dtoastr
90 90
91## begin gnulib module filemode
92
93
94EXTRA_DIST += filemode.c filemode.h
95
96EXTRA_libgnu_a_SOURCES += filemode.c
97
98## end gnulib module filemode
99
91## begin gnulib module getloadavg 100## begin gnulib module getloadavg
92 101
93 102
@@ -331,6 +340,65 @@ EXTRA_libgnu_a_SOURCES += strftime.c
331 340
332## end gnulib module strftime 341## end gnulib module strftime
333 342
343## begin gnulib module sys_stat
344
345BUILT_SOURCES += sys/stat.h
346
347# We need the following in order to create <sys/stat.h> when the system
348# has one that is incomplete.
349sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
350 $(AM_V_at)$(MKDIR_P) sys
351 $(AM_V_GEN)rm -f $@-t $@ && \
352 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
353 sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
354 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
355 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
356 -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
357 -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
358 -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
359 -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
360 -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
361 -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
362 -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
363 -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
364 -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
365 -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
366 -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
367 -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
368 -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
369 -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
370 -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
371 -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
372 -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
373 -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
374 -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
375 -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
376 -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
377 -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
378 -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
379 -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
380 -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
381 -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
382 -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
383 -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
384 -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
385 -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
386 -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
387 -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
388 -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
389 -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
390 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
391 -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
392 < $(srcdir)/sys_stat.in.h; \
393 } > $@-t && \
394 mv $@-t $@
395MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
396MOSTLYCLEANDIRS += sys
397
398EXTRA_DIST += sys_stat.in.h
399
400## end gnulib module sys_stat
401
334## begin gnulib module time 402## begin gnulib module time
335 403
336BUILT_SOURCES += time.h 404BUILT_SOURCES += time.h
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
new file mode 100644
index 00000000000..61cdcc53928
--- /dev/null
+++ b/lib/sys_stat.in.h
@@ -0,0 +1,646 @@
1/* Provide a more complete sys/stat header file.
2 Copyright (C) 2005-2011 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
17
18/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */
19
20/* This file is supposed to be used on platforms where <sys/stat.h> is
21 incomplete. It is intended to provide definitions and prototypes
22 needed by an application. Start with what the system provides. */
23
24#if __GNUC__ >= 3
25@PRAGMA_SYSTEM_HEADER@
26#endif
27@PRAGMA_COLUMNS@
28
29#if defined __need_system_sys_stat_h
30/* Special invocation convention. */
31
32#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
33
34#else
35/* Normal invocation convention. */
36
37#ifndef _GL_SYS_STAT_H
38
39/* Get nlink_t. */
40#include <sys/types.h>
41
42/* Get struct timespec. */
43#include <time.h>
44
45/* The include_next requires a split double-inclusion guard. */
46#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
47
48#ifndef _GL_SYS_STAT_H
49#define _GL_SYS_STAT_H
50
51/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
52
53/* The definition of _GL_ARG_NONNULL is copied here. */
54
55/* The definition of _GL_WARN_ON_USE is copied here. */
56
57/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
58 headers that may declare mkdir(). */
59#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
60# include <io.h> /* mingw32, mingw64 */
61# include <direct.h> /* mingw64 */
62#endif
63
64#ifndef S_IFMT
65# define S_IFMT 0170000
66#endif
67
68#if STAT_MACROS_BROKEN
69# undef S_ISBLK
70# undef S_ISCHR
71# undef S_ISDIR
72# undef S_ISFIFO
73# undef S_ISLNK
74# undef S_ISNAM
75# undef S_ISMPB
76# undef S_ISMPC
77# undef S_ISNWK
78# undef S_ISREG
79# undef S_ISSOCK
80#endif
81
82#ifndef S_ISBLK
83# ifdef S_IFBLK
84# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
85# else
86# define S_ISBLK(m) 0
87# endif
88#endif
89
90#ifndef S_ISCHR
91# ifdef S_IFCHR
92# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
93# else
94# define S_ISCHR(m) 0
95# endif
96#endif
97
98#ifndef S_ISDIR
99# ifdef S_IFDIR
100# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
101# else
102# define S_ISDIR(m) 0
103# endif
104#endif
105
106#ifndef S_ISDOOR /* Solaris 2.5 and up */
107# define S_ISDOOR(m) 0
108#endif
109
110#ifndef S_ISFIFO
111# ifdef S_IFIFO
112# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
113# else
114# define S_ISFIFO(m) 0
115# endif
116#endif
117
118#ifndef S_ISLNK
119# ifdef S_IFLNK
120# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
121# else
122# define S_ISLNK(m) 0
123# endif
124#endif
125
126#ifndef S_ISMPB /* V7 */
127# ifdef S_IFMPB
128# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
129# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
130# else
131# define S_ISMPB(m) 0
132# define S_ISMPC(m) 0
133# endif
134#endif
135
136#ifndef S_ISNAM /* Xenix */
137# ifdef S_IFNAM
138# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
139# else
140# define S_ISNAM(m) 0
141# endif
142#endif
143
144#ifndef S_ISNWK /* HP/UX */
145# ifdef S_IFNWK
146# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
147# else
148# define S_ISNWK(m) 0
149# endif
150#endif
151
152#ifndef S_ISPORT /* Solaris 10 and up */
153# define S_ISPORT(m) 0
154#endif
155
156#ifndef S_ISREG
157# ifdef S_IFREG
158# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
159# else
160# define S_ISREG(m) 0
161# endif
162#endif
163
164#ifndef S_ISSOCK
165# ifdef S_IFSOCK
166# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
167# else
168# define S_ISSOCK(m) 0
169# endif
170#endif
171
172
173#ifndef S_TYPEISMQ
174# define S_TYPEISMQ(p) 0
175#endif
176
177#ifndef S_TYPEISTMO
178# define S_TYPEISTMO(p) 0
179#endif
180
181
182#ifndef S_TYPEISSEM
183# ifdef S_INSEM
184# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
185# else
186# define S_TYPEISSEM(p) 0
187# endif
188#endif
189
190#ifndef S_TYPEISSHM
191# ifdef S_INSHD
192# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
193# else
194# define S_TYPEISSHM(p) 0
195# endif
196#endif
197
198/* high performance ("contiguous data") */
199#ifndef S_ISCTG
200# define S_ISCTG(p) 0
201#endif
202
203/* Cray DMF (data migration facility): off line, with data */
204#ifndef S_ISOFD
205# define S_ISOFD(p) 0
206#endif
207
208/* Cray DMF (data migration facility): off line, with no data */
209#ifndef S_ISOFL
210# define S_ISOFL(p) 0
211#endif
212
213/* 4.4BSD whiteout */
214#ifndef S_ISWHT
215# define S_ISWHT(m) 0
216#endif
217
218/* If any of the following are undefined,
219 define them to their de facto standard values. */
220#if !S_ISUID
221# define S_ISUID 04000
222#endif
223#if !S_ISGID
224# define S_ISGID 02000
225#endif
226
227/* S_ISVTX is a common extension to POSIX. */
228#ifndef S_ISVTX
229# define S_ISVTX 01000
230#endif
231
232#if !S_IRUSR && S_IREAD
233# define S_IRUSR S_IREAD
234#endif
235#if !S_IRUSR
236# define S_IRUSR 00400
237#endif
238#if !S_IRGRP
239# define S_IRGRP (S_IRUSR >> 3)
240#endif
241#if !S_IROTH
242# define S_IROTH (S_IRUSR >> 6)
243#endif
244
245#if !S_IWUSR && S_IWRITE
246# define S_IWUSR S_IWRITE
247#endif
248#if !S_IWUSR
249# define S_IWUSR 00200
250#endif
251#if !S_IWGRP
252# define S_IWGRP (S_IWUSR >> 3)
253#endif
254#if !S_IWOTH
255# define S_IWOTH (S_IWUSR >> 6)
256#endif
257
258#if !S_IXUSR && S_IEXEC
259# define S_IXUSR S_IEXEC
260#endif
261#if !S_IXUSR
262# define S_IXUSR 00100
263#endif
264#if !S_IXGRP
265# define S_IXGRP (S_IXUSR >> 3)
266#endif
267#if !S_IXOTH
268# define S_IXOTH (S_IXUSR >> 6)
269#endif
270
271#if !S_IRWXU
272# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
273#endif
274#if !S_IRWXG
275# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
276#endif
277#if !S_IRWXO
278# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
279#endif
280
281/* S_IXUGO is a common extension to POSIX. */
282#if !S_IXUGO
283# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
284#endif
285
286#ifndef S_IRWXUGO
287# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
288#endif
289
290/* Macros for futimens and utimensat. */
291#ifndef UTIME_NOW
292# define UTIME_NOW (-1)
293# define UTIME_OMIT (-2)
294#endif
295
296
297#if @GNULIB_FCHMODAT@
298# if !@HAVE_FCHMODAT@
299_GL_FUNCDECL_SYS (fchmodat, int,
300 (int fd, char const *file, mode_t mode, int flag)
301 _GL_ARG_NONNULL ((2)));
302# endif
303_GL_CXXALIAS_SYS (fchmodat, int,
304 (int fd, char const *file, mode_t mode, int flag));
305_GL_CXXALIASWARN (fchmodat);
306#elif defined GNULIB_POSIXCHECK
307# undef fchmodat
308# if HAVE_RAW_DECL_FCHMODAT
309_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
310 "use gnulib module openat for portability");
311# endif
312#endif
313
314
315#if @REPLACE_FSTAT@
316# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
317# define fstat rpl_fstat
318# endif
319_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
320_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
321#else
322_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
323#endif
324_GL_CXXALIASWARN (fstat);
325
326
327#if @GNULIB_FSTATAT@
328# if @REPLACE_FSTATAT@
329# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
330# undef fstatat
331# define fstatat rpl_fstatat
332# endif
333_GL_FUNCDECL_RPL (fstatat, int,
334 (int fd, char const *name, struct stat *st, int flags)
335 _GL_ARG_NONNULL ((2, 3)));
336_GL_CXXALIAS_RPL (fstatat, int,
337 (int fd, char const *name, struct stat *st, int flags));
338# else
339# if !@HAVE_FSTATAT@
340_GL_FUNCDECL_SYS (fstatat, int,
341 (int fd, char const *name, struct stat *st, int flags)
342 _GL_ARG_NONNULL ((2, 3)));
343# endif
344_GL_CXXALIAS_SYS (fstatat, int,
345 (int fd, char const *name, struct stat *st, int flags));
346# endif
347_GL_CXXALIASWARN (fstatat);
348#elif defined GNULIB_POSIXCHECK
349# undef fstatat
350# if HAVE_RAW_DECL_FSTATAT
351_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
352 "use gnulib module openat for portability");
353# endif
354#endif
355
356
357#if @GNULIB_FUTIMENS@
358# if @REPLACE_FUTIMENS@
359# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
360# undef futimens
361# define futimens rpl_futimens
362# endif
363_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
364_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
365# else
366# if !@HAVE_FUTIMENS@
367_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
368# endif
369_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
370# endif
371_GL_CXXALIASWARN (futimens);
372#elif defined GNULIB_POSIXCHECK
373# undef futimens
374# if HAVE_RAW_DECL_FUTIMENS
375_GL_WARN_ON_USE (futimens, "futimens is not portable - "
376 "use gnulib module futimens for portability");
377# endif
378#endif
379
380
381#if @GNULIB_LCHMOD@
382/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
383 denotes a symbolic link. */
384# if !@HAVE_LCHMOD@
385/* The lchmod replacement follows symbolic links. Callers should take
386 this into account; lchmod should be applied only to arguments that
387 are known to not be symbolic links. On hosts that lack lchmod,
388 this can lead to race conditions between the check and the
389 invocation of lchmod, but we know of no workarounds that are
390 reliable in general. You might try requesting support for lchmod
391 from your operating system supplier. */
392# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
393# define lchmod chmod
394# endif
395/* Need to cast, because on mingw, the second parameter of chmod is
396 int mode. */
397_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
398 (const char *filename, mode_t mode));
399# else
400# if 0 /* assume already declared */
401_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
402 _GL_ARG_NONNULL ((1)));
403# endif
404_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
405# endif
406# if @HAVE_LCHMOD@
407_GL_CXXALIASWARN (lchmod);
408# endif
409#elif defined GNULIB_POSIXCHECK
410# undef lchmod
411# if HAVE_RAW_DECL_LCHMOD
412_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
413 "use gnulib module lchmod for portability");
414# endif
415#endif
416
417
418#if @GNULIB_LSTAT@
419# if ! @HAVE_LSTAT@
420/* mingw does not support symlinks, therefore it does not have lstat. But
421 without links, stat does just fine. */
422# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
423# define lstat stat
424# endif
425_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
426# elif @REPLACE_LSTAT@
427# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
428# undef lstat
429# define lstat rpl_lstat
430# endif
431_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
432 _GL_ARG_NONNULL ((1, 2)));
433_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
434# else
435_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
436# endif
437# if @HAVE_LSTAT@
438_GL_CXXALIASWARN (lstat);
439# endif
440#elif defined GNULIB_POSIXCHECK
441# undef lstat
442# if HAVE_RAW_DECL_LSTAT
443_GL_WARN_ON_USE (lstat, "lstat is unportable - "
444 "use gnulib module lstat for portability");
445# endif
446#endif
447
448
449#if @REPLACE_MKDIR@
450# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
451# undef mkdir
452# define mkdir rpl_mkdir
453# endif
454_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
455 _GL_ARG_NONNULL ((1)));
456_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
457#else
458/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
459 Additionally, it declares _mkdir (and depending on compile flags, an
460 alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
461 which are included above. */
462# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
463
464# if !GNULIB_defined_rpl_mkdir
465static inline int
466rpl_mkdir (char const *name, mode_t mode)
467{
468 return _mkdir (name);
469}
470# define GNULIB_defined_rpl_mkdir 1
471# endif
472
473# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
474# define mkdir rpl_mkdir
475# endif
476_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
477# else
478_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
479# endif
480#endif
481_GL_CXXALIASWARN (mkdir);
482
483
484#if @GNULIB_MKDIRAT@
485# if !@HAVE_MKDIRAT@
486_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
487 _GL_ARG_NONNULL ((2)));
488# endif
489_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
490_GL_CXXALIASWARN (mkdirat);
491#elif defined GNULIB_POSIXCHECK
492# undef mkdirat
493# if HAVE_RAW_DECL_MKDIRAT
494_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
495 "use gnulib module openat for portability");
496# endif
497#endif
498
499
500#if @GNULIB_MKFIFO@
501# if @REPLACE_MKFIFO@
502# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
503# undef mkfifo
504# define mkfifo rpl_mkfifo
505# endif
506_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
507 _GL_ARG_NONNULL ((1)));
508_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
509# else
510# if !@HAVE_MKFIFO@
511_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
512 _GL_ARG_NONNULL ((1)));
513# endif
514_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
515# endif
516_GL_CXXALIASWARN (mkfifo);
517#elif defined GNULIB_POSIXCHECK
518# undef mkfifo
519# if HAVE_RAW_DECL_MKFIFO
520_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
521 "use gnulib module mkfifo for portability");
522# endif
523#endif
524
525
526#if @GNULIB_MKFIFOAT@
527# if !@HAVE_MKFIFOAT@
528_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
529 _GL_ARG_NONNULL ((2)));
530# endif
531_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
532_GL_CXXALIASWARN (mkfifoat);
533#elif defined GNULIB_POSIXCHECK
534# undef mkfifoat
535# if HAVE_RAW_DECL_MKFIFOAT
536_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
537 "use gnulib module mkfifoat for portability");
538# endif
539#endif
540
541
542#if @GNULIB_MKNOD@
543# if @REPLACE_MKNOD@
544# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
545# undef mknod
546# define mknod rpl_mknod
547# endif
548_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
549 _GL_ARG_NONNULL ((1)));
550_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
551# else
552# if !@HAVE_MKNOD@
553_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
554 _GL_ARG_NONNULL ((1)));
555# endif
556/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
557_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
558# endif
559_GL_CXXALIASWARN (mknod);
560#elif defined GNULIB_POSIXCHECK
561# undef mknod
562# if HAVE_RAW_DECL_MKNOD
563_GL_WARN_ON_USE (mknod, "mknod is not portable - "
564 "use gnulib module mknod for portability");
565# endif
566#endif
567
568
569#if @GNULIB_MKNODAT@
570# if !@HAVE_MKNODAT@
571_GL_FUNCDECL_SYS (mknodat, int,
572 (int fd, char const *file, mode_t mode, dev_t dev)
573 _GL_ARG_NONNULL ((2)));
574# endif
575_GL_CXXALIAS_SYS (mknodat, int,
576 (int fd, char const *file, mode_t mode, dev_t dev));
577_GL_CXXALIASWARN (mknodat);
578#elif defined GNULIB_POSIXCHECK
579# undef mknodat
580# if HAVE_RAW_DECL_MKNODAT
581_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
582 "use gnulib module mkfifoat for portability");
583# endif
584#endif
585
586
587#if @GNULIB_STAT@
588# if @REPLACE_STAT@
589/* We can't use the object-like #define stat rpl_stat, because of
590 struct stat. This means that rpl_stat will not be used if the user
591 does (stat)(a,b). Oh well. */
592# undef stat
593# ifdef _LARGE_FILES
594 /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
595 so we have to replace stat64() instead of stat(). */
596# define stat stat64
597# undef stat64
598# define stat64(name, st) rpl_stat (name, st)
599# else /* !_LARGE_FILES */
600# define stat(name, st) rpl_stat (name, st)
601# endif /* !_LARGE_FILES */
602_GL_EXTERN_C int stat (const char *name, struct stat *buf)
603 _GL_ARG_NONNULL ((1, 2));
604# endif
605#elif defined GNULIB_POSIXCHECK
606# undef stat
607# if HAVE_RAW_DECL_STAT
608_GL_WARN_ON_USE (stat, "stat is unportable - "
609 "use gnulib module stat for portability");
610# endif
611#endif
612
613
614#if @GNULIB_UTIMENSAT@
615# if @REPLACE_UTIMENSAT@
616# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
617# undef utimensat
618# define utimensat rpl_utimensat
619# endif
620_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
621 struct timespec const times[2], int flag)
622 _GL_ARG_NONNULL ((2)));
623_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
624 struct timespec const times[2], int flag));
625# else
626# if !@HAVE_UTIMENSAT@
627_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
628 struct timespec const times[2], int flag)
629 _GL_ARG_NONNULL ((2)));
630# endif
631_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
632 struct timespec const times[2], int flag));
633# endif
634_GL_CXXALIASWARN (utimensat);
635#elif defined GNULIB_POSIXCHECK
636# undef utimensat
637# if HAVE_RAW_DECL_UTIMENSAT
638_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
639 "use gnulib module utimensat for portability");
640# endif
641#endif
642
643
644#endif /* _GL_SYS_STAT_H */
645#endif /* _GL_SYS_STAT_H */
646#endif