The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/ipc.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1988 University of Utah.
    3  * Copyright (c) 1990, 1993
    4  *      The Regents of the University of California.  All rights reserved.
    5  * (c) UNIX System Laboratories, Inc.
    6  * All or some portions of this file are derived from material licensed
    7  * to the University of California by American Telephone and Telegraph
    8  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
    9  * the permission of UNIX System Laboratories, Inc.
   10  *
   11  * This code is derived from software contributed to Berkeley by
   12  * the Systems Programming Group of the University of Utah Computer
   13  * Science Department.
   14  *
   15  * Redistribution and use in source and binary forms, with or without
   16  * modification, are permitted provided that the following conditions
   17  * are met:
   18  * 1. Redistributions of source code must retain the above copyright
   19  *    notice, this list of conditions and the following disclaimer.
   20  * 2. Redistributions in binary form must reproduce the above copyright
   21  *    notice, this list of conditions and the following disclaimer in the
   22  *    documentation and/or other materials provided with the distribution.
   23  * 3. All advertising materials mentioning features or use of this software
   24  *    must display the following acknowledgement:
   25  *      This product includes software developed by the University of
   26  *      California, Berkeley and its contributors.
   27  * 4. Neither the name of the University nor the names of its contributors
   28  *    may be used to endorse or promote products derived from this software
   29  *    without specific prior written permission.
   30  *
   31  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   32  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   33  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   34  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   35  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   39  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   40  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   41  * SUCH DAMAGE.
   42  *
   43  *      @(#)ipc.h       8.4 (Berkeley) 2/19/95
   44  * $FreeBSD$
   45  */
   46 
   47 /*
   48  * SVID compatible ipc.h file
   49  */
   50 #ifndef _SYS_IPC_H_
   51 #define _SYS_IPC_H_
   52 
   53 struct ipc_perm {
   54         ushort  cuid;   /* creator user id */
   55         ushort  cgid;   /* creator group id */
   56         ushort  uid;    /* user id */
   57         ushort  gid;    /* group id */
   58         ushort  mode;   /* r/w permission */
   59         ushort  seq;    /* sequence # (to generate unique msg/sem/shm id) */
   60         key_t   key;    /* user specified msg/sem/shm key */
   61 };
   62 
   63 /* common mode bits */
   64 #define IPC_R           000400  /* read permission */
   65 #define IPC_W           000200  /* write/alter permission */
   66 #define IPC_M           010000  /* permission to change control info */
   67 
   68 /* SVID required constants (same values as system 5) */
   69 #define IPC_CREAT       001000  /* create entry if key does not exist */
   70 #define IPC_EXCL        002000  /* fail if key exists */
   71 #define IPC_NOWAIT      004000  /* error if request must wait */
   72 
   73 #define IPC_PRIVATE     (key_t)0 /* private key */
   74 
   75 #define IPC_RMID        0       /* remove identifier */
   76 #define IPC_SET         1       /* set options */
   77 #define IPC_STAT        2       /* get options */
   78 
   79 #ifdef _KERNEL
   80 /* Macros to convert between ipc ids and array indices or sequence ids */
   81 #define IPCID_TO_IX(id)         ((id) & 0xffff)
   82 #define IPCID_TO_SEQ(id)        (((id) >> 16) & 0xffff)
   83 #define IXSEQ_TO_IPCID(ix,perm) (((perm.seq) << 16) | (ix & 0xffff))
   84 
   85 struct proc;
   86 
   87 int     ipcperm __P((struct proc *, struct ipc_perm *, int));
   88 #else /* ! _KERNEL */
   89 
   90 /* XXX doesn't really belong here, but has been historical practice in SysV. */
   91 
   92 #include <sys/cdefs.h>
   93 
   94 __BEGIN_DECLS
   95 key_t   ftok __P((const char *, int));
   96 __END_DECLS
   97 
   98 #endif /* _KERNEL */
   99 
  100 #endif /* !_SYS_IPC_H_ */

Cache object: c46056ea9afeca64b1550db542781ef4


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.