5cf467ac6c1c382642019ae0347324d18bcda6b4
[debian/tar] / gnu / sys_stat.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Provide a more complete sys/stat header file.
4    Copyright (C) 2005-2013 Free 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, or (at your option)
9    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 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
20
21 /* This file is supposed to be used on platforms where <sys/stat.h> is
22    incomplete.  It is intended to provide definitions and prototypes
23    needed by an application.  Start with what the system provides.  */
24
25 #if __GNUC__ >= 3
26 @PRAGMA_SYSTEM_HEADER@
27 #endif
28 @PRAGMA_COLUMNS@
29
30 #if defined __need_system_sys_stat_h
31 /* Special invocation convention.  */
32
33 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
34
35 #else
36 /* Normal invocation convention.  */
37
38 #ifndef _@GUARD_PREFIX@_SYS_STAT_H
39
40 /* Get nlink_t.
41    May also define off_t to a 64-bit type on native Windows.  */
42 #include <sys/types.h>
43
44 /* Get struct timespec.  */
45 #include <time.h>
46
47 /* The include_next requires a split double-inclusion guard.  */
48 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
49
50 #ifndef _@GUARD_PREFIX@_SYS_STAT_H
51 #define _@GUARD_PREFIX@_SYS_STAT_H
52
53 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
54
55 /* The definition of _GL_ARG_NONNULL is copied here.  */
56
57 /* The definition of _GL_WARN_ON_USE is copied here.  */
58
59 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
60    headers that may declare mkdir().  Native Windows platforms declare mkdir
61    in <io.h> and/or <direct.h>, not in <unistd.h>.  */
62 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
63 # include <io.h>     /* mingw32, mingw64 */
64 # include <direct.h> /* mingw64, MSVC 9 */
65 #endif
66
67 /* Native Windows platforms declare umask() in <io.h>.  */
68 #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
69 # include <io.h>
70 #endif
71
72 /* Large File Support on native Windows.  */
73 #if @WINDOWS_64_BIT_ST_SIZE@
74 # define stat _stati64
75 #endif
76
77 #ifndef S_IFIFO
78 # ifdef _S_IFIFO
79 #  define S_IFIFO _S_IFIFO
80 # endif
81 #endif
82
83 #ifndef S_IFMT
84 # define S_IFMT 0170000
85 #endif
86
87 #if STAT_MACROS_BROKEN
88 # undef S_ISBLK
89 # undef S_ISCHR
90 # undef S_ISDIR
91 # undef S_ISFIFO
92 # undef S_ISLNK
93 # undef S_ISNAM
94 # undef S_ISMPB
95 # undef S_ISMPC
96 # undef S_ISNWK
97 # undef S_ISREG
98 # undef S_ISSOCK
99 #endif
100
101 #ifndef S_ISBLK
102 # ifdef S_IFBLK
103 #  define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
104 # else
105 #  define S_ISBLK(m) 0
106 # endif
107 #endif
108
109 #ifndef S_ISCHR
110 # ifdef S_IFCHR
111 #  define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
112 # else
113 #  define S_ISCHR(m) 0
114 # endif
115 #endif
116
117 #ifndef S_ISDIR
118 # ifdef S_IFDIR
119 #  define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
120 # else
121 #  define S_ISDIR(m) 0
122 # endif
123 #endif
124
125 #ifndef S_ISDOOR /* Solaris 2.5 and up */
126 # define S_ISDOOR(m) 0
127 #endif
128
129 #ifndef S_ISFIFO
130 # ifdef S_IFIFO
131 #  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
132 # else
133 #  define S_ISFIFO(m) 0
134 # endif
135 #endif
136
137 #ifndef S_ISLNK
138 # ifdef S_IFLNK
139 #  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
140 # else
141 #  define S_ISLNK(m) 0
142 # endif
143 #endif
144
145 #ifndef S_ISMPB /* V7 */
146 # ifdef S_IFMPB
147 #  define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
148 #  define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
149 # else
150 #  define S_ISMPB(m) 0
151 #  define S_ISMPC(m) 0
152 # endif
153 #endif
154
155 #ifndef S_ISMPX /* AIX */
156 # define S_ISMPX(m) 0
157 #endif
158
159 #ifndef S_ISNAM /* Xenix */
160 # ifdef S_IFNAM
161 #  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
162 # else
163 #  define S_ISNAM(m) 0
164 # endif
165 #endif
166
167 #ifndef S_ISNWK /* HP/UX */
168 # ifdef S_IFNWK
169 #  define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
170 # else
171 #  define S_ISNWK(m) 0
172 # endif
173 #endif
174
175 #ifndef S_ISPORT /* Solaris 10 and up */
176 # define S_ISPORT(m) 0
177 #endif
178
179 #ifndef S_ISREG
180 # ifdef S_IFREG
181 #  define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
182 # else
183 #  define S_ISREG(m) 0
184 # endif
185 #endif
186
187 #ifndef S_ISSOCK
188 # ifdef S_IFSOCK
189 #  define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
190 # else
191 #  define S_ISSOCK(m) 0
192 # endif
193 #endif
194
195
196 #ifndef S_TYPEISMQ
197 # define S_TYPEISMQ(p) 0
198 #endif
199
200 #ifndef S_TYPEISTMO
201 # define S_TYPEISTMO(p) 0
202 #endif
203
204
205 #ifndef S_TYPEISSEM
206 # ifdef S_INSEM
207 #  define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
208 # else
209 #  define S_TYPEISSEM(p) 0
210 # endif
211 #endif
212
213 #ifndef S_TYPEISSHM
214 # ifdef S_INSHD
215 #  define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
216 # else
217 #  define S_TYPEISSHM(p) 0
218 # endif
219 #endif
220
221 /* high performance ("contiguous data") */
222 #ifndef S_ISCTG
223 # define S_ISCTG(p) 0
224 #endif
225
226 /* Cray DMF (data migration facility): off line, with data  */
227 #ifndef S_ISOFD
228 # define S_ISOFD(p) 0
229 #endif
230
231 /* Cray DMF (data migration facility): off line, with no data  */
232 #ifndef S_ISOFL
233 # define S_ISOFL(p) 0
234 #endif
235
236 /* 4.4BSD whiteout */
237 #ifndef S_ISWHT
238 # define S_ISWHT(m) 0
239 #endif
240
241 /* If any of the following are undefined,
242    define them to their de facto standard values.  */
243 #if !S_ISUID
244 # define S_ISUID 04000
245 #endif
246 #if !S_ISGID
247 # define S_ISGID 02000
248 #endif
249
250 /* S_ISVTX is a common extension to POSIX.  */
251 #ifndef S_ISVTX
252 # define S_ISVTX 01000
253 #endif
254
255 #if !S_IRUSR && S_IREAD
256 # define S_IRUSR S_IREAD
257 #endif
258 #if !S_IRUSR
259 # define S_IRUSR 00400
260 #endif
261 #if !S_IRGRP
262 # define S_IRGRP (S_IRUSR >> 3)
263 #endif
264 #if !S_IROTH
265 # define S_IROTH (S_IRUSR >> 6)
266 #endif
267
268 #if !S_IWUSR && S_IWRITE
269 # define S_IWUSR S_IWRITE
270 #endif
271 #if !S_IWUSR
272 # define S_IWUSR 00200
273 #endif
274 #if !S_IWGRP
275 # define S_IWGRP (S_IWUSR >> 3)
276 #endif
277 #if !S_IWOTH
278 # define S_IWOTH (S_IWUSR >> 6)
279 #endif
280
281 #if !S_IXUSR && S_IEXEC
282 # define S_IXUSR S_IEXEC
283 #endif
284 #if !S_IXUSR
285 # define S_IXUSR 00100
286 #endif
287 #if !S_IXGRP
288 # define S_IXGRP (S_IXUSR >> 3)
289 #endif
290 #if !S_IXOTH
291 # define S_IXOTH (S_IXUSR >> 6)
292 #endif
293
294 #if !S_IRWXU
295 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
296 #endif
297 #if !S_IRWXG
298 # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
299 #endif
300 #if !S_IRWXO
301 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
302 #endif
303
304 /* S_IXUGO is a common extension to POSIX.  */
305 #if !S_IXUGO
306 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
307 #endif
308
309 #ifndef S_IRWXUGO
310 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
311 #endif
312
313 /* Macros for futimens and utimensat.  */
314 #ifndef UTIME_NOW
315 # define UTIME_NOW (-1)
316 # define UTIME_OMIT (-2)
317 #endif
318
319
320 #if @GNULIB_FCHMODAT@
321 # if !@HAVE_FCHMODAT@
322 _GL_FUNCDECL_SYS (fchmodat, int,
323                   (int fd, char const *file, mode_t mode, int flag)
324                   _GL_ARG_NONNULL ((2)));
325 # endif
326 _GL_CXXALIAS_SYS (fchmodat, int,
327                   (int fd, char const *file, mode_t mode, int flag));
328 _GL_CXXALIASWARN (fchmodat);
329 #elif defined GNULIB_POSIXCHECK
330 # undef fchmodat
331 # if HAVE_RAW_DECL_FCHMODAT
332 _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
333                  "use gnulib module openat for portability");
334 # endif
335 #endif
336
337
338 #if @GNULIB_FSTAT@
339 # if @REPLACE_FSTAT@
340 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
341 #   undef fstat
342 #   define fstat rpl_fstat
343 #  endif
344 _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
345 _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
346 # else
347 _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
348 # endif
349 _GL_CXXALIASWARN (fstat);
350 #elif @WINDOWS_64_BIT_ST_SIZE@
351 /* Above, we define stat to _stati64.  */
352 # define fstat _fstati64
353 #elif defined GNULIB_POSIXCHECK
354 # undef fstat
355 # if HAVE_RAW_DECL_FSTAT
356 _GL_WARN_ON_USE (fstat, "fstat has portability problems - "
357                  "use gnulib module fstat for portability");
358 # endif
359 #endif
360
361
362 #if @GNULIB_FSTATAT@
363 # if @REPLACE_FSTATAT@
364 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
365 #   undef fstatat
366 #   define fstatat rpl_fstatat
367 #  endif
368 _GL_FUNCDECL_RPL (fstatat, int,
369                   (int fd, char const *name, struct stat *st, int flags)
370                   _GL_ARG_NONNULL ((2, 3)));
371 _GL_CXXALIAS_RPL (fstatat, int,
372                   (int fd, char const *name, struct stat *st, int flags));
373 # else
374 #  if !@HAVE_FSTATAT@
375 _GL_FUNCDECL_SYS (fstatat, int,
376                   (int fd, char const *name, struct stat *st, int flags)
377                   _GL_ARG_NONNULL ((2, 3)));
378 #  endif
379 _GL_CXXALIAS_SYS (fstatat, int,
380                   (int fd, char const *name, struct stat *st, int flags));
381 # endif
382 _GL_CXXALIASWARN (fstatat);
383 #elif defined GNULIB_POSIXCHECK
384 # undef fstatat
385 # if HAVE_RAW_DECL_FSTATAT
386 _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
387                  "use gnulib module openat for portability");
388 # endif
389 #endif
390
391
392 #if @GNULIB_FUTIMENS@
393 /* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
394    implementation relies on futimesat, which on Solaris 10 makes an invocation
395    to futimens that is meant to invoke the libc's futimens(), not gnulib's
396    futimens().  */
397 # if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
398 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
399 #   undef futimens
400 #   define futimens rpl_futimens
401 #  endif
402 _GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
403 _GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
404 # else
405 #  if !@HAVE_FUTIMENS@
406 _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
407 #  endif
408 _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
409 # endif
410 # if @HAVE_FUTIMENS@
411 _GL_CXXALIASWARN (futimens);
412 # endif
413 #elif defined GNULIB_POSIXCHECK
414 # undef futimens
415 # if HAVE_RAW_DECL_FUTIMENS
416 _GL_WARN_ON_USE (futimens, "futimens is not portable - "
417                  "use gnulib module futimens for portability");
418 # endif
419 #endif
420
421
422 #if @GNULIB_LCHMOD@
423 /* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
424    denotes a symbolic link.  */
425 # if !@HAVE_LCHMOD@
426 /* The lchmod replacement follows symbolic links.  Callers should take
427    this into account; lchmod should be applied only to arguments that
428    are known to not be symbolic links.  On hosts that lack lchmod,
429    this can lead to race conditions between the check and the
430    invocation of lchmod, but we know of no workarounds that are
431    reliable in general.  You might try requesting support for lchmod
432    from your operating system supplier.  */
433 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
434 #   define lchmod chmod
435 #  endif
436 /* Need to cast, because on mingw, the second parameter of chmod is
437                                                 int mode.  */
438 _GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
439                          (const char *filename, mode_t mode));
440 # else
441 #  if 0 /* assume already declared */
442 _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
443                                _GL_ARG_NONNULL ((1)));
444 #  endif
445 _GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
446 # endif
447 # if @HAVE_LCHMOD@
448 _GL_CXXALIASWARN (lchmod);
449 # endif
450 #elif defined GNULIB_POSIXCHECK
451 # undef lchmod
452 # if HAVE_RAW_DECL_LCHMOD
453 _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
454                  "use gnulib module lchmod for portability");
455 # endif
456 #endif
457
458
459 #if @GNULIB_LSTAT@
460 # if ! @HAVE_LSTAT@
461 /* mingw does not support symlinks, therefore it does not have lstat.  But
462    without links, stat does just fine.  */
463 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
464 #   define lstat stat
465 #  endif
466 _GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
467 # elif @REPLACE_LSTAT@
468 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
469 #   undef lstat
470 #   define lstat rpl_lstat
471 #  endif
472 _GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
473                               _GL_ARG_NONNULL ((1, 2)));
474 _GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
475 # else
476 _GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
477 # endif
478 # if @HAVE_LSTAT@
479 _GL_CXXALIASWARN (lstat);
480 # endif
481 #elif defined GNULIB_POSIXCHECK
482 # undef lstat
483 # if HAVE_RAW_DECL_LSTAT
484 _GL_WARN_ON_USE (lstat, "lstat is unportable - "
485                  "use gnulib module lstat for portability");
486 # endif
487 #endif
488
489
490 #if @REPLACE_MKDIR@
491 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
492 #  undef mkdir
493 #  define mkdir rpl_mkdir
494 # endif
495 _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
496                               _GL_ARG_NONNULL ((1)));
497 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
498 #else
499 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
500    Additionally, it declares _mkdir (and depending on compile flags, an
501    alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
502    which are included above.  */
503 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
504
505 #  if !GNULIB_defined_rpl_mkdir
506 static int
507 rpl_mkdir (char const *name, mode_t mode)
508 {
509   return _mkdir (name);
510 }
511 #   define GNULIB_defined_rpl_mkdir 1
512 #  endif
513
514 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
515 #   define mkdir rpl_mkdir
516 #  endif
517 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
518 # else
519 _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
520 # endif
521 #endif
522 _GL_CXXALIASWARN (mkdir);
523
524
525 #if @GNULIB_MKDIRAT@
526 # if !@HAVE_MKDIRAT@
527 _GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
528                                 _GL_ARG_NONNULL ((2)));
529 # endif
530 _GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
531 _GL_CXXALIASWARN (mkdirat);
532 #elif defined GNULIB_POSIXCHECK
533 # undef mkdirat
534 # if HAVE_RAW_DECL_MKDIRAT
535 _GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
536                  "use gnulib module openat for portability");
537 # endif
538 #endif
539
540
541 #if @GNULIB_MKFIFO@
542 # if @REPLACE_MKFIFO@
543 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
544 #   undef mkfifo
545 #   define mkfifo rpl_mkfifo
546 #  endif
547 _GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
548                                _GL_ARG_NONNULL ((1)));
549 _GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
550 # else
551 #  if !@HAVE_MKFIFO@
552 _GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
553                                _GL_ARG_NONNULL ((1)));
554 #  endif
555 _GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
556 # endif
557 _GL_CXXALIASWARN (mkfifo);
558 #elif defined GNULIB_POSIXCHECK
559 # undef mkfifo
560 # if HAVE_RAW_DECL_MKFIFO
561 _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
562                  "use gnulib module mkfifo for portability");
563 # endif
564 #endif
565
566
567 #if @GNULIB_MKFIFOAT@
568 # if !@HAVE_MKFIFOAT@
569 _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
570                                  _GL_ARG_NONNULL ((2)));
571 # endif
572 _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
573 _GL_CXXALIASWARN (mkfifoat);
574 #elif defined GNULIB_POSIXCHECK
575 # undef mkfifoat
576 # if HAVE_RAW_DECL_MKFIFOAT
577 _GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
578                  "use gnulib module mkfifoat for portability");
579 # endif
580 #endif
581
582
583 #if @GNULIB_MKNOD@
584 # if @REPLACE_MKNOD@
585 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
586 #   undef mknod
587 #   define mknod rpl_mknod
588 #  endif
589 _GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
590                               _GL_ARG_NONNULL ((1)));
591 _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
592 # else
593 #  if !@HAVE_MKNOD@
594 _GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
595                               _GL_ARG_NONNULL ((1)));
596 #  endif
597 /* Need to cast, because on OSF/1 5.1, the third parameter is '...'.  */
598 _GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
599 # endif
600 _GL_CXXALIASWARN (mknod);
601 #elif defined GNULIB_POSIXCHECK
602 # undef mknod
603 # if HAVE_RAW_DECL_MKNOD
604 _GL_WARN_ON_USE (mknod, "mknod is not portable - "
605                  "use gnulib module mknod for portability");
606 # endif
607 #endif
608
609
610 #if @GNULIB_MKNODAT@
611 # if !@HAVE_MKNODAT@
612 _GL_FUNCDECL_SYS (mknodat, int,
613                   (int fd, char const *file, mode_t mode, dev_t dev)
614                   _GL_ARG_NONNULL ((2)));
615 # endif
616 _GL_CXXALIAS_SYS (mknodat, int,
617                   (int fd, char const *file, mode_t mode, dev_t dev));
618 _GL_CXXALIASWARN (mknodat);
619 #elif defined GNULIB_POSIXCHECK
620 # undef mknodat
621 # if HAVE_RAW_DECL_MKNODAT
622 _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
623                  "use gnulib module mkfifoat for portability");
624 # endif
625 #endif
626
627
628 #if @GNULIB_STAT@
629 # if @REPLACE_STAT@
630 /* We can't use the object-like #define stat rpl_stat, because of
631    struct stat.  This means that rpl_stat will not be used if the user
632    does (stat)(a,b).  Oh well.  */
633 #  if defined _AIX && defined stat && defined _LARGE_FILES
634     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
635        so we have to replace stat64() instead of stat(). */
636 #   undef stat64
637 #   define stat64(name, st) rpl_stat (name, st)
638 #  elif @WINDOWS_64_BIT_ST_SIZE@
639     /* Above, we define stat to _stati64.  */
640 #   if defined __MINGW32__ && defined _stati64
641 #    ifndef _USE_32BIT_TIME_T
642       /* The system headers define _stati64 to _stat64.  */
643 #     undef _stat64
644 #     define _stat64(name, st) rpl_stat (name, st)
645 #    endif
646 #   elif defined _MSC_VER && defined _stati64
647 #    ifdef _USE_32BIT_TIME_T
648       /* The system headers define _stati64 to _stat32i64.  */
649 #     undef _stat32i64
650 #     define _stat32i64(name, st) rpl_stat (name, st)
651 #    else
652       /* The system headers define _stati64 to _stat64.  */
653 #     undef _stat64
654 #     define _stat64(name, st) rpl_stat (name, st)
655 #    endif
656 #   else
657 #    undef _stati64
658 #    define _stati64(name, st) rpl_stat (name, st)
659 #   endif
660 #  elif defined __MINGW32__ && defined stat
661 #   ifdef _USE_32BIT_TIME_T
662      /* The system headers define stat to _stat32i64.  */
663 #    undef _stat32i64
664 #    define _stat32i64(name, st) rpl_stat (name, st)
665 #   else
666      /* The system headers define stat to _stat64.  */
667 #    undef _stat64
668 #    define _stat64(name, st) rpl_stat (name, st)
669 #   endif
670 #  elif defined _MSC_VER && defined stat
671 #   ifdef _USE_32BIT_TIME_T
672      /* The system headers define stat to _stat32.  */
673 #    undef _stat32
674 #    define _stat32(name, st) rpl_stat (name, st)
675 #   else
676      /* The system headers define stat to _stat64i32.  */
677 #    undef _stat64i32
678 #    define _stat64i32(name, st) rpl_stat (name, st)
679 #   endif
680 #  else /* !(_AIX ||__MINGW32__ ||  _MSC_VER) */
681 #   undef stat
682 #   define stat(name, st) rpl_stat (name, st)
683 #  endif /* !_LARGE_FILES */
684 _GL_EXTERN_C int stat (const char *name, struct stat *buf)
685                       _GL_ARG_NONNULL ((1, 2));
686 # endif
687 #elif defined GNULIB_POSIXCHECK
688 # undef stat
689 # if HAVE_RAW_DECL_STAT
690 _GL_WARN_ON_USE (stat, "stat is unportable - "
691                  "use gnulib module stat for portability");
692 # endif
693 #endif
694
695
696 #if @GNULIB_UTIMENSAT@
697 /* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
698    implementation relies on futimesat, which on Solaris 10 makes an invocation
699    to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
700    utimensat().  */
701 # if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
702 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
703 #   undef utimensat
704 #   define utimensat rpl_utimensat
705 #  endif
706 _GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
707                                    struct timespec const times[2], int flag)
708                                   _GL_ARG_NONNULL ((2)));
709 _GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
710                                    struct timespec const times[2], int flag));
711 # else
712 #  if !@HAVE_UTIMENSAT@
713 _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
714                                    struct timespec const times[2], int flag)
715                                   _GL_ARG_NONNULL ((2)));
716 #  endif
717 _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
718                                    struct timespec const times[2], int flag));
719 # endif
720 # if @HAVE_UTIMENSAT@
721 _GL_CXXALIASWARN (utimensat);
722 # endif
723 #elif defined GNULIB_POSIXCHECK
724 # undef utimensat
725 # if HAVE_RAW_DECL_UTIMENSAT
726 _GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
727                  "use gnulib module utimensat for portability");
728 # endif
729 #endif
730
731
732 #endif /* _@GUARD_PREFIX@_SYS_STAT_H */
733 #endif /* _@GUARD_PREFIX@_SYS_STAT_H */
734 #endif