+2009-09-07 Eric Blake <ebb9@byu.net>
+
+ openat: provide more convenience names
+ * modules/faccessat (configure.ac): Add C witness.
+ * lib/unistd.in.h (readlinkat): Fix typo.
+ * lib/openat.h (statat, lstatat, accessat, euidaccessat): New
+ convenience wrappers.
+ * top/maint.mk (sc_prohibit_openat_without_use): Allow these
+ wrappers in syntax checks.
+
2009-09-06 Eric Blake <ebb9@byu.net>
doc: fix comments in recent patches
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
+static inline int
+statat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, 0);
+}
+
+static inline int
+lstatat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#if GNULIB_FACCESSAT
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+ since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+ since access rights on symlinks are of limited utility. */
+
+static inline int
+accessat (int fd, char const *file, int mode)
+{
+ return faccessat (fd, file, mode, 0);
+}
+
+static inline int
+euidaccessat (int fd, char const *file, int mode)
+{
+ return faccessat (fd, file, mode, AT_EACCESS);
+}
+#endif
+
#endif /* _GL_HEADER_OPENAT */
#elif defined GNULIB_POSIXCHECK
# undef readlinkat
# define readlinkat(d,n,b,l) \
- (GL_LINK_WARNING ("faccessat is not portable - " \
+ (GL_LINK_WARNING ("readlinkat is not portable - " \
"use gnulib module symlinkat for portability"), \
readlinkat (d, n, b, l))
#endif
sc_prohibit_openat_without_use:
@h='"openat.h"' \
- re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?ch(own|mod)at)\>' \
+ re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>' \
$(_header_without_use)
# Prohibit the inclusion of c-ctype.h without an actual use.