summaryrefslogtreecommitdiff
path: root/libtrivfs/trivfs.h
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-12 01:00:35 +0000
committerMiles Bader <miles@gnu.org>1995-08-12 01:00:35 +0000
commitb01c8972e93e0afe3a742bdac2021c258beb709b (patch)
treef284f3a00c8100524b6f4913420e15ad668d4f4b /libtrivfs/trivfs.h
parent205fbb3925b9022304a44508deeeca1d1826c0e5 (diff)
(trivfs_protid_create_hook, trivfs_peropen_create_hook): Change the
declarations now that these return an error code.
Diffstat (limited to 'libtrivfs/trivfs.h')
-rw-r--r--libtrivfs/trivfs.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 8beea672..830c4ac4 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -30,6 +30,8 @@ struct trivfs_protid
uid_t *uids, *gids;
int nuids, ngids;
int isroot;
+ /* REALNODE will be null if this protid wasn't fully created (currently
+ only in the case where trivfs_protid_create_hook returns an error). */
mach_port_t realnode; /* restricted permissions */
void *hook; /* for user use */
struct trivfs_peropen *po;
@@ -92,11 +94,11 @@ error_t (*trivfs_check_open_hook) (struct trivfs_control *cntl,
/* 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 *);
+error_t (*trivfs_protid_create_hook) (struct trivfs_protid *);
/* If this variable is set, it is called every time a new peropen
structure is created and initialized. */
-void (*trivfs_peropen_create_hook) (struct trivfs_peropen *);
+error_t (*trivfs_peropen_create_hook) (struct trivfs_peropen *);
/* If this variable is set, it is called every time a protid structure
is about to be destroyed. */
@@ -138,6 +140,22 @@ void trivfs_clean_cntl (void *);
/* This demultiplees messages for trivfs ports. */
int trivfs_demuxer (mach_msg_header_t *, mach_msg_header_t *);
+/* Return a new protid pointing to a new peropen in CRED, with REALNODE as
+ the underlying node reference, with the given identity, and open flags in
+ FLAGS. CNTL is the trivfs control object. */
+error_t trivfs_open (struct trivfs_control *fsys,
+ uid_t *uids, unsigned num_uids,
+ gid_t *gids, unsigned num_gids,
+ unsigned flags,
+ mach_port_t realnode,
+ struct trivfs_protid **cred);
+
+/* Return a duplicate of CRED in DUP, sharing the same peropen and hook. A
+ non-null hook may be used to detect that this is a duplicate by
+ trivfs_peropen_create_hook. */
+error_t trivfs_protid_dup (struct trivfs_protid *cred,
+ struct trivfs_protid **dup);
+
/* The user must define this function. Someone wants the filesystem
to go away. FLAGS are from the set FSYS_GOAWAY_*; REALNODE,
CNTLTYPE, and PROTIDTYPE are as from the trivfs_handle_port