Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / src / afs / IRIX / osi_gcpags.c
blob6b456d7ab0fa80e6eee964a3315bf91c85fa7b7a
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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
8 */
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 */
18 #if AFS_GCPAGS
20 /* afs_osi_TraverseProcTable() - Walk through the systems process
21 * table, calling afs_GCPAGs_perproc_func() for each process.
25 #ifdef AFS_SGI65_ENV
26 /* TODO: Fix this later. */
27 static int
28 SGI_ProcScanFunc(void *p, void *arg, int mode)
30 return 0;
32 #else /* AFS_SGI65_ENV */
33 static int
34 SGI_ProcScanFunc(proc_t * p, void *arg, int mode)
36 afs_int32(*perproc_func) (afs_proc_t *) = arg;
37 int code = 0;
38 /* we pass in the function pointer for arg,
39 * mode ==0 for startup call, ==1 for each valid proc,
40 * and ==2 for terminate call.
42 if (mode == 1) {
43 code = perproc_func(p);
45 return code;
47 #endif /* AFS_SGI65_ENV */
49 void
50 afs_osi_TraverseProcTable(void)
52 procscan(SGI_ProcScanFunc, afs_GCPAGs_perproc_func);
55 /* return a pointer (sometimes a static copy ) to the cred for a
56 * given afs_proc_t.
57 * subsequent calls may overwrite the previously returned value.
60 #if defined(AFS_SGI65_ENV)
61 const afs_ucred_t *
62 afs_osi_proc2cred(afs_proc_t * p)
64 return NULL;
67 #else
68 const afs_ucred_t *
69 afs_osi_proc2cred(afs_proc_t * pr)
71 afs_ucred_t *rv = NULL;
73 if (pr == NULL) {
74 return NULL;
76 rv = pr->p_cred;
78 return rv;
80 #endif
82 #endif /* AFS_GCPAGS */