1
1
/* provide a replacement openat function
2
Copyright (C) 2004-2006, 2008-2011 Free Software Foundation, Inc.
2
Copyright (C) 2004-2006, 2008-2012 Free Software Foundation, Inc.
4
4
This program is free software: you can redistribute it and/or modify
5
5
it under the terms of the GNU General Public License as published by
47
48
/* Using these function names makes application code
48
49
slightly more readable than it would be with
49
50
fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
54
# ifndef FCHOWNAT_INLINE
55
# define FCHOWNAT_INLINE _GL_INLINE
51
59
chownat (int fd, char const *file, uid_t owner, gid_t group)
53
61
return fchownat (fd, file, owner, group, 0);
57
65
lchownat (int fd, char const *file, uid_t owner, gid_t group)
59
67
return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
74
# ifndef FCHMODAT_INLINE
75
# define FCHMODAT_INLINE _GL_INLINE
63
79
chmodat (int fd, char const *file, mode_t mode)
65
81
return fchmodat (fd, file, mode, 0);
69
85
lchmodat (int fd, char const *file, mode_t mode)
71
87
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
94
# ifndef FSTATAT_INLINE
95
# define FSTATAT_INLINE _GL_INLINE
75
99
statat (int fd, char const *name, struct stat *st)
77
101
return fstatat (fd, name, st, 0);
81
105
lstatat (int fd, char const *name, struct stat *st)
83
107
return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
86
112
/* For now, there are no wrappers named laccessat or leuidaccessat,
87
113
since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
88
114
since access rights on symlinks are of limited utility. Likewise,
89
115
wrappers are not provided for accessat or euidaccessat, so as to
90
116
avoid dragging in -lgen on some platforms. */
118
_GL_INLINE_HEADER_END
92
120
#endif /* _GL_HEADER_OPENAT */