Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166680179
D19330.id54559.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
D19330.id54559.diff
View Options
Index: head/sys/kern/uipc_shm.c
===================================================================
--- head/sys/kern/uipc_shm.c
+++ head/sys/kern/uipc_shm.c
@@ -60,6 +60,7 @@
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
+#include <sys/filio.h>
#include <sys/fnv_hash.h>
#include <sys/kernel.h>
#include <sys/uio.h>
@@ -126,6 +127,7 @@
static fo_rdwr_t shm_read;
static fo_rdwr_t shm_write;
static fo_truncate_t shm_truncate;
+static fo_ioctl_t shm_ioctl;
static fo_stat_t shm_stat;
static fo_close_t shm_close;
static fo_chmod_t shm_chmod;
@@ -139,7 +141,7 @@
.fo_read = shm_read,
.fo_write = shm_write,
.fo_truncate = shm_truncate,
- .fo_ioctl = invfo_ioctl,
+ .fo_ioctl = shm_ioctl,
.fo_poll = invfo_poll,
.fo_kqfilter = invfo_kqfilter,
.fo_stat = shm_stat,
@@ -361,6 +363,24 @@
return (error);
#endif
return (shm_dotruncate(shmfd, length));
+}
+
+int
+shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred,
+ struct thread *td)
+{
+
+ switch (com) {
+ case FIONBIO:
+ case FIOASYNC:
+ /*
+ * Allow fcntl(fd, F_SETFL, O_NONBLOCK) to work,
+ * just like it would on an unlinked regular file
+ */
+ return (0);
+ default:
+ return (ENOTTY);
+ }
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 16, 12:11 PM (10 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36823662
Default Alt Text
D19330.id54559.diff (1 KB)
Attached To
Mode
D19330: Allow setting O_NONBLOCK on shm file descriptors
Attached
Detach File
Event Timeline
Log In to Comment