projects
/
platform
/
upstream
/
glibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77e4dc6
)
(__pathconf): For _PC_ASYNC_IO test whether named file is a regular file or a block...
author
Ulrich Drepper
<drepper@redhat.com>
Mon, 23 Apr 2001 09:04:59 +0000
(09:04 +0000)
committer
Ulrich Drepper
<drepper@redhat.com>
Mon, 23 Apr 2001 09:04:59 +0000
(09:04 +0000)
sysdeps/posix/pathconf.c
patch
|
blob
|
history
diff --git
a/sysdeps/posix/pathconf.c
b/sysdeps/posix/pathconf.c
index
4ce5c0d
..
63a3a9c
100644
(file)
--- a/
sysdeps/posix/pathconf.c
+++ b/
sysdeps/posix/pathconf.c
@@
-21,6
+21,7
@@
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
+#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
@@
-138,7
+139,16
@@
__pathconf (const char *path, int 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 (__xstat64 (_STAT_VER, path, &st) < 0
+ || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode)))
+ return -1;
+ else
+ return 1;
+ }
#else
return -1;
#endif