2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include "afs/param.h"
14 #include "afs/sysincludes.h" /* Standard vendor system headers */
15 #include "afsincludes.h" /* Afs-based standard headers */
16 #include "afs/afs_stats.h" /* afs statistics */
20 /* afs_osi_TraverseProcTable() - Walk through the systems process
21 * table, calling afs_GCPAGs_perproc_func() for each process.
25 afs_osi_TraverseProcTable(void)
28 LIST_FOREACH(p, &allproc, p_list) {
29 if (p->p_stat == SIDL)
31 if (p->p_stat == SZOMB)
33 if (p->p_flag & P_SYSTEM)
35 afs_GCPAGs_perproc_func(p);
39 /* return a pointer (sometimes a static copy ) to the cred for a
41 * subsequent calls may overwrite the previously returned value.
44 afs_osi_proc2cred(afs_proc_t * pr)
46 afs_ucred_t *rv = NULL;
47 static afs_ucred_t cr;
53 if ((pr->p_stat == SSLEEP) || (pr->p_stat == SRUN)
54 || (pr->p_stat == SSTOP)) {
57 afs_set_cr_uid(&cr, afs_cr_uid(pr->p_cred->pc_ucred));
58 cr.cr_ngroups = pr->p_cred->pc_ucred->cr_ngroups;
59 memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups,
60 NGROUPS * sizeof(gid_t));
68 #endif /* AFS_GCPAGS */