aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-23 09:06:27 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-23 09:06:27 +0000
commitbc183edc4e9fb3bd3bf68a99592e5b9e6a850d79 (patch)
tree695fb80ff9afc227cf55f633559184b92d9827d8
parent92c2e46b9663794c4585bf65f5e53d61638227aa (diff)
downloadglibc-bc183edc4e9fb3bd3bf68a99592e5b9e6a850d79.tar
glibc-bc183edc4e9fb3bd3bf68a99592e5b9e6a850d79.tar.gz
glibc-bc183edc4e9fb3bd3bf68a99592e5b9e6a850d79.tar.bz2
glibc-bc183edc4e9fb3bd3bf68a99592e5b9e6a850d79.zip
Update.
2001-04-23 Ulrich Drepper <drepper@redhat.com> * 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.
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/posix/fpathconf.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 590903b30b..2bd3112792 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-23 Ulrich Drepper <drepper@redhat.com>
+
+ * 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.
+
2001-04-23 Andreas Jaeger <aj@suse.de>
* nscd/nscd.h: Add noreturn attribute for start_threads.
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 <stddef.h>
#include <unistd.h>
#include <limits.h>
+#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
@@ -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