diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-05-03 20:21:24 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-05-03 20:21:24 +0000 |
commit | 182429e8d07761dbfb1f214e67175b6c94af61ac (patch) | |
tree | c73455871555d637cae4e1e94ea51ab2cef9f59a /sys/kern/uipc_sem.c | |
parent | b927ad2b6c78b0bb39fd483a05dc222183c2bc00 (diff) | |
download | FreeBSD-src-182429e8d07761dbfb1f214e67175b6c94af61ac.zip FreeBSD-src-182429e8d07761dbfb1f214e67175b6c94af61ac.tar.gz |
Move definitions of 'struct kuser' and 'struct ksem' from uipc_sem.c
to ksem.h so that they are accessible from the MAC Framework for the
purposes of labeling and enforcing additional protections. #error
if these are included without _KERNEL, since they are not intended
(nor installed) for user application use.
Submitted by: Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Sponsored by: DARPA, SPARTA
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/kern/uipc_sem.c')
-rw-r--r-- | sys/kern/uipc_sem.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/sys/kern/uipc_sem.c b/sys/kern/uipc_sem.c index 5366f3a..ea5dedc 100644 --- a/sys/kern/uipc_sem.c +++ b/sys/kern/uipc_sem.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/fcntl.h> +#include <posix4/ksem.h> #include <posix4/posix4.h> #include <posix4/semaphore.h> #include <posix4/_semaphore.h> @@ -86,25 +87,6 @@ static int kern_sem_unlink(struct thread *td, const char *name); #define SEM_TO_ID(x) ((intptr_t)(x)) #define ID_TO_SEM(x) id_to_sem(x) -struct kuser { - pid_t ku_pid; - LIST_ENTRY(kuser) ku_next; -}; - -struct ksem { - LIST_ENTRY(ksem) ks_entry; /* global list entry */ - int ks_onlist; /* boolean if on a list (ks_entry) */ - char *ks_name; /* if named, this is the name */ - int ks_ref; /* number of references */ - mode_t ks_mode; /* protection bits */ - uid_t ks_uid; /* creator uid */ - gid_t ks_gid; /* creator gid */ - unsigned int ks_value; /* current value */ - struct cv ks_cv; /* waiters sleep here */ - int ks_waiters; /* number of waiters */ - LIST_HEAD(, kuser) ks_users; /* pids using this sem */ -}; - /* * available semaphores go here, this includes sem_init and any semaphores * created via sem_open that have not yet been unlinked. |