Use fdopendir, fstatat and readlinkat, for efficiency.
[bpt/emacs.git] / lib / careadlinkat.h
index 4f0184b..965573b 100644 (file)
@@ -1,6 +1,6 @@
 /* Read symbolic links into a buffer without size limitation, relative to fd.
 
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -52,12 +52,11 @@ char *careadlinkat (int fd, char const *filename,
                     ssize_t (*preadlinkat) (int, char const *,
                                             char *, size_t));
 
-/* Suitable values for careadlinkat's FD and PREADLINKAT arguments,
+/* Suitable value for careadlinkat's FD argument,
    when doing a plain readlink:
-   Pass FD = AT_FDCWD and PREADLINKAT = careadlinkatcwd.  */
+   Pass FD = AT_FDCWD.  */
 #if HAVE_READLINKAT
-/* AT_FDCWD is declared in <fcntl.h>, readlinkat in <unistd.h>.  */
-# define careadlinkatcwd readlinkat
+/* AT_FDCWD is declared in <fcntl.h>.  */
 #else
 /* Define AT_FDCWD independently, so that the careadlinkat module does
    not depend on the fcntl-h module.  The value does not matter, since
@@ -66,8 +65,6 @@ char *careadlinkat (int fd, char const *filename,
 # ifndef AT_FDCWD
 #  define AT_FDCWD (-3041965)
 # endif
-ssize_t careadlinkatcwd (int fd, char const *filename,
-                         char *buffer, size_t buffer_size);
 #endif
 
 #endif /* _GL_CAREADLINKAT_H */