]> code.delx.au - gnu-emacs/blobdiff - lib/readlinkat.c
Merge from emacs-24; up to 117634
[gnu-emacs] / lib / readlinkat.c
index 504e6ebbc49a80fd71ab8cf8ccd4df9791d6cd5f..83ea0af02e473d3dbc866893822541c6a52b8c74 100644 (file)
@@ -1,5 +1,5 @@
 /* Read a symlink relative to an open directory.
-   Copyright (C) 2009-2013 Free Software Foundation, Inc.
+   Copyright (C) 2009-2014 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
 
 #include <unistd.h>
 
+#if HAVE_READLINKAT
+
+# undef readlinkat
+
+ssize_t
+rpl_readlinkat (int fd, char const *file, char *buf, size_t len)
+{
+  return readlinkat (fd, file, buf, len);
+}
+
+#else
+
 /* Gnulib provides a readlink stub for mingw; use it for distinction
    between EINVAL and ENOENT, rather than always failing with ENOSYS.  */
 
    then readlink/restore_cwd.  If either the save_cwd or the restore_cwd
    fails, then give a diagnostic and exit nonzero.  */
 
-#define AT_FUNC_NAME readlinkat
-#define AT_FUNC_F1 readlink
-#define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
-#define AT_FUNC_POST_FILE_ARGS        , buf, len
-#define AT_FUNC_RESULT ssize_t
-#include "at-func.c"
-#undef AT_FUNC_NAME
-#undef AT_FUNC_F1
-#undef AT_FUNC_POST_FILE_PARAM_DECLS
-#undef AT_FUNC_POST_FILE_ARGS
-#undef AT_FUNC_RESULT
+# define AT_FUNC_NAME readlinkat
+# define AT_FUNC_F1 readlink
+# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len
+# define AT_FUNC_POST_FILE_ARGS        , buf, len
+# define AT_FUNC_RESULT ssize_t
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+# undef AT_FUNC_RESULT
+
+#endif