This source file includes following definitions.
- chownat
- lchownat
- chmodat
- lchmodat
- statat
- lstatat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef _GL_HEADER_OPENAT
20 #define _GL_HEADER_OPENAT
21
22
23
24 #if !_GL_CONFIG_H_INCLUDED
25 #error "Please include config.h first."
26 #endif
27
28 #include <fcntl.h>
29
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <unistd.h>
33
34 _GL_INLINE_HEADER_BEGIN
35
36 #if !HAVE_OPENAT
37
38 int openat_permissive (int fd, char const *file, int flags, mode_t mode,
39 int *cwd_errno);
40 bool openat_needs_fchdir (void);
41
42 #else
43
44 # define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \
45 openat (Fd, File, Flags, Mode)
46 # define openat_needs_fchdir() false
47
48 #endif
49
50 _Noreturn void openat_restore_fail (int);
51 _Noreturn void openat_save_fail (int);
52
53
54
55
56
57 #if GNULIB_CHOWNAT
58
59 # ifndef CHOWNAT_INLINE
60 # define CHOWNAT_INLINE _GL_INLINE
61 # endif
62
63 CHOWNAT_INLINE int
64 chownat (int fd, char const *file, uid_t owner, gid_t group)
65 {
66 return fchownat (fd, file, owner, group, 0);
67 }
68
69 CHOWNAT_INLINE int
70 lchownat (int fd, char const *file, uid_t owner, gid_t group)
71 {
72 return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
73 }
74
75 #endif
76
77 #if GNULIB_CHMODAT
78
79 # ifndef CHMODAT_INLINE
80 # define CHMODAT_INLINE _GL_INLINE
81 # endif
82
83 CHMODAT_INLINE int
84 chmodat (int fd, char const *file, mode_t mode)
85 {
86 return fchmodat (fd, file, mode, 0);
87 }
88
89 CHMODAT_INLINE int
90 lchmodat (int fd, char const *file, mode_t mode)
91 {
92 return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
93 }
94
95 #endif
96
97 #if GNULIB_STATAT
98
99 # ifndef STATAT_INLINE
100 # define STATAT_INLINE _GL_INLINE
101 # endif
102
103 _GL_ATTRIBUTE_DEPRECATED
104 STATAT_INLINE int
105 statat (int fd, char const *name, struct stat *st)
106 {
107 return fstatat (fd, name, st, 0);
108 }
109
110 _GL_ATTRIBUTE_DEPRECATED
111 STATAT_INLINE int
112 lstatat (int fd, char const *name, struct stat *st)
113 {
114 return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
115 }
116
117 #endif
118
119
120
121
122
123
124
125 _GL_INLINE_HEADER_END
126
127 #endif