summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtrivfs/trivfs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 1a75315e..6cec812f 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -40,6 +40,7 @@ struct trivfs_control
struct port_info pi;
int protidtypes;
mach_port_t underlying;
+ struct pending_open *openshead, *openstail;
};
/* The user must define these variables. */
@@ -61,6 +62,25 @@ extern int trivfs_cntl_nporttypes;
nothing. */
void trivfs_modify_stat (struct stat *);
+/* If this variable is set, it is called every time an open happens.
+ UIDS, GIDS, and FLAGS are from the open; CNTL identifies the
+ node being opened. This call need not check permissions on the underlying
+ node. If the open call should block, then return EWOULDBLOCK. Other
+ errors are immediately reflected to the user. If O_NONBLOCK
+ is not set in FLAGS and EWOULDBLOCK is returned, then call
+ trivfs_complete_open when all pending open requests for this
+ file can complete. */
+error_t (*trivfs_check_open_hook) (struct trivfs_control *cntl,
+ uid_t *uids, u_int nuids,
+ gid_t *gids, u_int ngids,
+ int flags);
+
+/* Call this after *trivfs_check_open_hook returns EWOULDBLOCK when
+ FLAGS did not include O_NONBLOCK. CNTL identifies the node now
+ openable. If MULTI is nonzero, then return all pending opens,
+ otherwise, return only one. */
+void trivfs_complete_open (struct trivfs_control *cntl, int multi);
+
/* If this variable is set, it is called every time a new protid
structure is created and initialized. */
void (*trivfs_protid_create_hook) (struct trivfs_protid *);