-#define FG_TERM 0x01 /* the fileglob is terminating .. */
-#define FG_INSMSGQ 0x02 /* insert to msgqueue pending .. */
-#define FG_WINSMSGQ 0x04 /* wait for the fielglob is in msgque */
-#define FG_RMMSGQ 0x08 /* the fileglob is being removed from msgqueue */
-#define FG_WRMMSGQ 0x10 /* wait for the fileglob to be removed from msgqueue */
-#define FG_PORTMADE 0x20 /* a port was at some point created for this fileglob */
+#define FG_TERM 0x01 /* the fileglob is terminating .. */
+#define FG_INSMSGQ 0x02 /* insert to msgqueue pending .. */
+#define FG_WINSMSGQ 0x04 /* wait for the fielglob is in msgque */
+#define FG_RMMSGQ 0x08 /* the fileglob is being removed from msgqueue */
+#define FG_WRMMSGQ 0x10 /* wait for the fileglob to be removed from msgqueue */
+#define FG_PORTMADE 0x20 /* a port was at some point created for this fileglob */
+#define FG_NOSIGPIPE 0x40 /* don't deliver SIGPIPE with EPIPE return */
+#define FG_OFF_LOCKED 0x80 /* Used as a mutex for offset changes (for vnodes) */
+#define FG_OFF_LOCKWANT 0x100 /* Somebody's wating for the lock */
+#define FG_CONFINED 0x200 /* fileglob confined to process, immutably */
+#define FG_HAS_OFDLOCK 0x400 /* Has or has had an OFD lock */
+
+struct fileops {
+ file_type_t fo_type; /* descriptor type */
+ int (*fo_read) (struct fileproc *fp, struct uio *uio,
+ int flags, vfs_context_t ctx);
+ int (*fo_write) (struct fileproc *fp, struct uio *uio,
+ int flags, vfs_context_t ctx);
+#define FOF_OFFSET 0x00000001 /* offset supplied to vn_write */
+#define FOF_PCRED 0x00000002 /* cred from proc, not current thread */
+ int (*fo_ioctl)(struct fileproc *fp, u_long com,
+ caddr_t data, vfs_context_t ctx);
+ int (*fo_select) (struct fileproc *fp, int which,
+ void *wql, vfs_context_t ctx);
+ int (*fo_close) (struct fileglob *fg, vfs_context_t ctx);
+ int (*fo_kqfilter) (struct fileproc *fp, struct knote *, struct kevent_qos_s *);
+ int (*fo_drain) (struct fileproc *fp, vfs_context_t ctx);
+};