home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / procset.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.3 KB  |  121 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_PROCSET_H
  11. #define _SYS_PROCSET_H
  12.  
  13. #ident    "@(#)/usr/include/sys/procset.h.sl 1.1 4.0 12/08/90 12189 AT&T-USL"
  14.  
  15. /*    This file defines the data needed to specify a set of
  16. **    processes.  These types are used by the sigsend, sigsendset,
  17. **    priocntl, priocntlset, waitid, evexit, and evexitset system
  18. **    calls.
  19. */
  20.  
  21. #define    P_INITPID    1
  22. #define    P_INITUID    0
  23. #define    P_INITPGID    0
  24.  
  25.  
  26. /*    The following defines the values for an identifier type.  It
  27. **    specifies the interpretation of an id value.  An idtype and
  28. **    id together define a simple set of processes.
  29. */
  30.  
  31. typedef enum idtype {
  32.     P_PID,        /* A process identifier.        */
  33.     P_PPID,        /* A parent process identifier.        */
  34.     P_PGID,        /* A process group (job control group)    */
  35.             /* identifier.                */
  36.     P_SID,        /* A session identifier.        */
  37.     P_CID,        /* A scheduling class identifier.    */
  38.     P_UID,        /* A user identifier.            */
  39.     P_GID,        /* A group identifier.            */
  40.     P_ALL        /* All processes.            */
  41. } idtype_t;
  42.  
  43.  
  44. /*    The following defines the operations which can be performed to
  45. **    combine two simple sets of processes to form another set of
  46. **    processes.
  47. */
  48.  
  49. typedef enum idop {
  50.     POP_DIFF,    /* Set difference.  The processes which    */
  51.             /* are in the left operand set and not    */
  52.             /* in the right operand set.        */
  53.     POP_AND,    /* Set disjunction.  The processes    */
  54.             /* which are in both the left and right    */
  55.             /* operand sets.            */
  56.     POP_OR,        /* Set conjunction.  The processes    */
  57.             /* which are in either the left or the    */
  58.             /* right operand sets (or both).    */
  59.     POP_XOR        /* Set exclusive or.  The processes     */
  60.             /* which are in either the left or    */
  61.             /* right operand sets but not in both.    */
  62. } idop_t;
  63.  
  64.  
  65. /*    The following structure is used to define a set of processes.
  66. **    The set is defined in terms of two simple sets of processes
  67. **    and an operator which operates on these two operand sets.
  68. */
  69.  
  70. typedef struct procset {
  71.     idop_t        p_op;    /* The operator connection the    */
  72.                 /* following two operands each    */
  73.                 /* of which is a simple set of    */
  74.                 /* processes.            */
  75.  
  76.     idtype_t    p_lidtype;
  77.                 /* The type of the left operand    */
  78.                 /* simple set.            */
  79.     id_t        p_lid;    /* The id of the left operand.    */
  80.  
  81.     idtype_t    p_ridtype;
  82.                 /* The type of the right    */
  83.                 /* operand simple set.        */
  84.     id_t        p_rid;    /* The id of the right operand.    */
  85. } procset_t;
  86.  
  87.  
  88. /*    The following macro can be used to initialize a procset_t
  89. **    structure.
  90. */
  91.  
  92. #define    setprocset(psp, op, ltype, lid, rtype, rid) \
  93.             (psp)->p_op        = (op); \
  94.             (psp)->p_lidtype    = (ltype); \
  95.             (psp)->p_lid        = (lid); \
  96.             (psp)->p_ridtype    = (rtype); \
  97.             (psp)->p_rid        = (rid);
  98.  
  99. #ifdef _KERNEL
  100.  
  101. /*
  102.  * Public functions.
  103.  */
  104. #if defined(__STDC__)
  105.  
  106. extern int dotoprocs(procset_t *psp, int (*funcp)(), char *arg);
  107. extern int procinset(proc_t *pp, procset_t *psp);
  108. extern boolean_t cur_inset_only(procset_t *psp);
  109.  
  110. #else
  111.  
  112. extern int dotoprocs();
  113. extern int procinset();
  114. extern boolean_t cur_inset_only();
  115.  
  116. #endif    /* __STDC__ */
  117.  
  118. #endif    /* _KERNEL */
  119.  
  120. #endif    /* _SYS_PROCSET_H */
  121.