diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-09 11:44:05 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-04-09 11:44:05 -0700 |
commit | e5b28a7aef4446e07fa6a74df1254caec5add54e (patch) | |
tree | df72bb12451e55f26a78bcf6271927c8ac9180d1 /lib | |
parent | 762f8d96719ba3e8a0e79d8bb99fe8e119fafb3a (diff) |
Merge from gnulib.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/allocator.h | 3 | ||||
-rw-r--r-- | lib/careadlinkat.c | 5 | ||||
-rw-r--r-- | lib/careadlinkat.h | 10 |
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/allocator.h b/lib/allocator.h index a89ba32b09..953117da83 100644 --- a/lib/allocator.h +++ b/lib/allocator.h @@ -18,6 +18,7 @@ /* Written by Paul Eggert. */ #ifndef _GL_ALLOCATOR_H +#define _GL_ALLOCATOR_H #include <stddef.h> @@ -53,4 +54,4 @@ struct allocator /* An allocator using the stdlib functions and a null DIE function. */ extern struct allocator const stdlib_allocator; -#endif +#endif /* _GL_ALLOCATOR_H */ diff --git a/lib/careadlinkat.c b/lib/careadlinkat.c index 7a7806d121..01883db9ce 100644 --- a/lib/careadlinkat.c +++ b/lib/careadlinkat.c @@ -65,7 +65,10 @@ careadlinkatcwd (int fd, char const *filename, char *buffer, the returned value if it is nonnull and is not BUFFER. A null ALLOC stands for the standard allocator. - 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. */ 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 |