From bc183edc4e9fb3bd3bf68a99592e5b9e6a850d79 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 23 Apr 2001 09:06:27 +0000 Subject: Update. 2001-04-23 Ulrich Drepper * sysdeps/posix/pathconf.c (__pathconf): For _PC_ASYNC_IO test whether named file is a regular file or a block device. * sysdeps/posix/fpathconf.c (__fpathconf): Likewise. --- sysdeps/posix/fpathconf.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sysdeps/posix/fpathconf.c') diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c index 539a6caa25..16f349d953 100644 --- a/sysdeps/posix/fpathconf.c +++ b/sysdeps/posix/fpathconf.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -142,7 +143,16 @@ __fpathconf (fd, name) case _PC_ASYNC_IO: #ifdef _POSIX_ASYNC_IO - return _POSIX_ASYNC_IO; + { + /* AIO is only allowed on regular files and block devices. */ + struct stat64 st; + + if (__fxstat64 (_STAT_VER, fd, &st) < 0 + || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode))) + return -1; + else + return 1; + } #else return -1; #endif -- cgit v1.2.3