Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156664057
D24814.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D24814.diff
View Options
Index: lib/libc/sys/read.2
===================================================================
--- lib/libc/sys/read.2
+++ lib/libc/sys/read.2
@@ -28,7 +28,7 @@
.\" @(#)read.2 8.4 (Berkeley) 2/26/94
.\" $FreeBSD$
.\"
-.Dd March 30, 2020
+.Dd May 13, 2020
.Dt READ 2
.Os
.Sh NAME
@@ -199,9 +199,10 @@
The file was marked for non-blocking I/O,
and no data were ready to be read.
.It Bq Er EISDIR
-The file descriptor is associated with a directory residing
-on a file system that does not allow regular read operations on
-directories (e.g.\& NFS).
+The file descriptor is associated with a directory.
+The
+.Xr readdir 3
+function should be used instead.
.It Bq Er EOPNOTSUPP
The file descriptor is associated with a file system and file type that
do not allow regular read operations on it.
Index: sys/kern/vfs_vnops.c
===================================================================
--- sys/kern/vfs_vnops.c
+++ sys/kern/vfs_vnops.c
@@ -792,6 +792,8 @@
uio->uio_td, td));
KASSERT(flags & FOF_OFFSET, ("No FOF_OFFSET"));
vp = fp->f_vnode;
+ if (vp->v_type == VDIR)
+ return (EISDIR);
ioflag = 0;
if (fp->f_flag & FNONBLOCK)
ioflag |= IO_NDELAY;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 12:49 PM (14 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33130145
Default Alt Text
D24814.diff (1 KB)
Attached To
Mode
D24814: Return EISDIR when read() and pread()'ing a directory.
Attached
Detach File
Event Timeline
Log In to Comment