summary refs log tree commit diff
path: root/io/fstatat.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/fstatat.c')
-rw-r--r--io/fstatat.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/io/fstatat.c b/io/fstatat.c
index 19242b7d5d..07f4afb996 100644
--- a/io/fstatat.c
+++ b/io/fstatat.c
@@ -16,12 +16,26 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <sys/stat.h>
+#include <errno.h>
 
-#undef __fstatat
 int
 __fstatat (int fd, const char *file, struct stat *buf, int flag)
 {
-  return __fxstatat (_STAT_VER, fd, file, buf, flag);
+  if (fd < 0 && fd != AT_FDCWD)
+    {
+      __set_errno (EBADF);
+      return -1;
+    }
+  if (buf == NULL || (flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  __set_errno (ENOSYS);
+  return -1;
 }
 
 weak_alias (__fstatat, fstatat)
+
+stub_warning (fstatat)