Fix BZ 18675 -- fpathconf(_PC_NAME_MAX) fails against large filesystems for 32bit processes
Commit Message
Greetings,
The patch attached to
https://sourceware.org/bugzilla/show_bug.cgi?id=18675 looks good to
me.
I am not sure whether Justin has the paterwork filed, but since this
is on the trivial side and is directly patterned after the fix for
https://sourceware.org/bugzilla/show_bug.cgi?id=15514, perhaps that's
ok?
Tested on Linux/x86_64 and i386. No new failures.
Thanks,
2015-09-06 Justin Maggard <jmaggard@netgear.com>
[BZ #18675]
* sysdeps/posix/fpathconf.c (__fpathconf): Use __fstatvfs64.
Comments
@@ -66,10 +66,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 +83,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