summaryrefslogtreecommitdiff
path: root/lib/careadlinkat.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-04-09 11:44:05 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-04-09 11:44:05 -0700
commite5b28a7aef4446e07fa6a74df1254caec5add54e (patch)
treedf72bb12451e55f26a78bcf6271927c8ac9180d1 /lib/careadlinkat.h
parent762f8d96719ba3e8a0e79d8bb99fe8e119fafb3a (diff)
Merge from gnulib.
Diffstat (limited to 'lib/careadlinkat.h')
-rw-r--r--lib/careadlinkat.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
index c5e4bcfc15..4f0184bbc3 100644
--- a/lib/careadlinkat.h
+++ b/lib/careadlinkat.h
@@ -18,6 +18,7 @@
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
#ifndef _GL_CAREADLINKAT_H
+#define _GL_CAREADLINKAT_H
#include <fcntl.h>
#include <unistd.h>
@@ -37,7 +38,10 @@ struct allocator;
buffer managed by ALLOC. It is the caller's responsibility to free
the returned value if it is nonnull and is not BUFFER.
- The PREADLINKAT function specifies how to read links.
+ The PREADLINKAT function specifies how to read links. It operates
+ like POSIX readlinkat()
+ <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>
+ but can assume that its first argument is the same as FD.
If successful, return the buffer address; otherwise return NULL and
set errno. */
@@ -49,8 +53,10 @@ char *careadlinkat (int fd, char const *filename,
char *, size_t));
/* Suitable values for careadlinkat's FD and PREADLINKAT arguments,
- when doing a plain readlink. */
+ when doing a plain readlink:
+ Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd. */
#if HAVE_READLINKAT
+/* AT_FDCWD is declared in <fcntl.h>, readlinkat in <unistd.h>. */
# define careadlinkatcwd readlinkat
#else
/* Define AT_FDCWD independently, so that the careadlinkat module does