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