summaryrefslogtreecommitdiff
path: root/sysdeps/posix/fpathconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/fpathconf.c')
-rw-r--r--sysdeps/posix/fpathconf.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index 25f632ee84..4aaded14be 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,9 +26,7 @@
/* Get file-specific information about descriptor FD. */
long int
-__fpathconf (fd, name)
- int fd;
- int name;
+__fpathconf (int fd, int name)
{
if (fd < 0)
{
@@ -66,10 +64,10 @@ __fpathconf (fd, name)
case _PC_NAME_MAX:
#ifdef NAME_MAX
{
- struct statfs buf;
+ struct statvfs64 sv;
int save_errno = errno;
- if (__fstatfs (fd, &buf) < 0)
+ if (__fstatvfs64 (fd, &sv) < 0)
{
if (errno == ENOSYS)
{
@@ -83,15 +81,7 @@ __fpathconf (fd, name)
}
else
{
-#ifdef _STATFS_F_NAMELEN
- return buf.f_namelen;
-#else
-# ifdef _STATFS_F_NAME_MAX
- return buf.f_name_max;
-# else
- return NAME_MAX;
-# endif
-#endif
+ return sv.f_namemax;
}
}
#else