]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/sem_internal.h
xnu-1228.tar.gz
[apple/xnu.git] / bsd / sys / sem_internal.h
index 647a3adaac40aea29920dd6c174e757170ab23c8..e59aca2aa93d9ff28d2ac119542d736f7afd0811 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * 
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
+/*
+ * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
+ * support for mandatory and extensible security protections.  This notice
+ * is included in support of clause 2.2 (b) of the Apple Public License,
+ * Version 2.0.
+ */
 /*     $NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $      */
 
 /*
@@ -120,7 +126,7 @@ typedef union user_semun user_semun_t;
  * Undo structure (internal: one per process)
  */
 struct sem_undo {
-       struct  sem_undo *un_next;      /* ptr to next active undo structure */
+       int     un_next_idx;    /* index of next active undo structure */
        struct  proc *un_proc;          /* owner of this structure */
        short   un_cnt;                 /* # of active entries */
        struct undo {
@@ -148,6 +154,15 @@ struct seminfo {
 };
 extern struct seminfo  seminfo;
 
+/*
+ * Kernel wrapper for the user-level structure
+ */
+struct semid_kernel {
+       struct  user_semid_ds u;
+       struct  label *label;   /* MAC framework label */
+};
+
+
 /* internal "mode" bits */
 #define        SEM_ALLOC       01000   /* semaphore is allocated */
 #define        SEM_DEST        02000   /* semaphore will be destroyed on last detach */
@@ -174,7 +189,7 @@ extern struct seminfo       seminfo;
  */
 #define SEMUSZ         sizeof(struct sem_undo)
 
-extern struct user_semid_ds    *sema;          /* semaphore id pool */
+extern struct semid_kernel     *sema;          /* semaphore id pool */
 extern struct sem              *sem_pool;      /* semaphore pool */
 /* This is now a struct sem_undo with the new memory allocation 
  * extern int  *semu;          // undo structure pool