Commit | Line | Data |
---|---|---|
805e021f CE |
1 | /* |
2 | * Copyright 2000, International Business Machines Corporation and others. | |
3 | * All Rights Reserved. | |
4 | * | |
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 | */ | |
9 | ||
10 | #include <afsconfig.h> | |
11 | #include "afs/param.h" | |
12 | ||
13 | ||
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 */ | |
17 | ||
18 | #if AFS_GCPAGS | |
19 | ||
20 | /* afs_osi_TraverseProcTable() - Walk through the systems process | |
21 | * table, calling afs_GCPAGs_perproc_func() for each process. | |
22 | */ | |
23 | ||
24 | ||
25 | #ifdef AFS_SGI65_ENV | |
26 | /* TODO: Fix this later. */ | |
27 | static int | |
28 | SGI_ProcScanFunc(void *p, void *arg, int mode) | |
29 | { | |
30 | return 0; | |
31 | } | |
32 | #else /* AFS_SGI65_ENV */ | |
33 | static int | |
34 | SGI_ProcScanFunc(proc_t * p, void *arg, int mode) | |
35 | { | |
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. | |
41 | */ | |
42 | if (mode == 1) { | |
43 | code = perproc_func(p); | |
44 | } | |
45 | return code; | |
46 | } | |
47 | #endif /* AFS_SGI65_ENV */ | |
48 | ||
49 | void | |
50 | afs_osi_TraverseProcTable(void) | |
51 | { | |
52 | procscan(SGI_ProcScanFunc, afs_GCPAGs_perproc_func); | |
53 | } | |
54 | ||
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. | |
58 | */ | |
59 | ||
60 | #if defined(AFS_SGI65_ENV) | |
61 | const afs_ucred_t * | |
62 | afs_osi_proc2cred(afs_proc_t * p) | |
63 | { | |
64 | return NULL; | |
65 | } | |
66 | ||
67 | #else | |
68 | const afs_ucred_t * | |
69 | afs_osi_proc2cred(afs_proc_t * pr) | |
70 | { | |
71 | afs_ucred_t *rv = NULL; | |
72 | ||
73 | if (pr == NULL) { | |
74 | return NULL; | |
75 | } | |
76 | rv = pr->p_cred; | |
77 | ||
78 | return rv; | |
79 | } | |
80 | #endif | |
81 | ||
82 | #endif /* AFS_GCPAGS */ |