Print this page
Code review comments from jeffpc


 386         gid_t   pr_rgid;        /* real group id */
 387         gid_t   pr_sgid;        /* saved group id (from exec) */
 388         int     pr_ngroups;     /* number of supplementary groups */
 389         gid_t   pr_groups[1];   /* array of supplementary groups */
 390 } prcred_t;
 391 
 392 /*
 393  * Process privileges.  PCSPRIV and /proc/<pid>/priv
 394  */
 395 typedef struct prpriv {
 396         uint32_t        pr_nsets;               /* number of privilege set */
 397         uint32_t        pr_setsize;             /* size of privilege set */
 398         uint32_t        pr_infosize;            /* size of supplementary data */
 399         priv_chunk_t    pr_sets[1];             /* array of sets */
 400 } prpriv_t;
 401 
 402 #define PRSECFLAGS_VERSION_1            1
 403 #define PRSECFLAGS_VERSION_CURRENT      PRSECFLAGS_VERSION_1
 404 typedef struct prsecflags {
 405         uint32_t pr_version;

 406         secflagset_t pr_effective;
 407         secflagset_t pr_inherit;
 408         secflagset_t pr_lower;
 409         secflagset_t pr_upper;
 410 } prsecflags_t;
 411 
 412 /*
 413  * Watchpoint interface.  PCWATCH and /proc/<pid>/watch
 414  */
 415 typedef struct prwatch {
 416         uintptr_t pr_vaddr;     /* virtual address of watched area */
 417         size_t  pr_size;        /* size of watched area in bytes */
 418         int     pr_wflags;      /* watch type flags */
 419         int     pr_pad;
 420 } prwatch_t;
 421 
 422 /* pr_wflags */
 423 #define WA_READ         0x04    /* trap on read access */
 424 #define WA_WRITE        0x02    /* trap on write access */
 425 #define WA_EXEC         0x01    /* trap on execute access */




 386         gid_t   pr_rgid;        /* real group id */
 387         gid_t   pr_sgid;        /* saved group id (from exec) */
 388         int     pr_ngroups;     /* number of supplementary groups */
 389         gid_t   pr_groups[1];   /* array of supplementary groups */
 390 } prcred_t;
 391 
 392 /*
 393  * Process privileges.  PCSPRIV and /proc/<pid>/priv
 394  */
 395 typedef struct prpriv {
 396         uint32_t        pr_nsets;               /* number of privilege set */
 397         uint32_t        pr_setsize;             /* size of privilege set */
 398         uint32_t        pr_infosize;            /* size of supplementary data */
 399         priv_chunk_t    pr_sets[1];             /* array of sets */
 400 } prpriv_t;
 401 
 402 #define PRSECFLAGS_VERSION_1            1
 403 #define PRSECFLAGS_VERSION_CURRENT      PRSECFLAGS_VERSION_1
 404 typedef struct prsecflags {
 405         uint32_t pr_version;
 406         char pr_pad[4];
 407         secflagset_t pr_effective;
 408         secflagset_t pr_inherit;
 409         secflagset_t pr_lower;
 410         secflagset_t pr_upper;
 411 } prsecflags_t;
 412 
 413 /*
 414  * Watchpoint interface.  PCWATCH and /proc/<pid>/watch
 415  */
 416 typedef struct prwatch {
 417         uintptr_t pr_vaddr;     /* virtual address of watched area */
 418         size_t  pr_size;        /* size of watched area in bytes */
 419         int     pr_wflags;      /* watch type flags */
 420         int     pr_pad;
 421 } prwatch_t;
 422 
 423 /* pr_wflags */
 424 #define WA_READ         0x04    /* trap on read access */
 425 #define WA_WRITE        0x02    /* trap on write access */
 426 #define WA_EXEC         0x01    /* trap on execute access */