LICENSE IPL10
add curpag() support for aix, based on work by tom keiser
#include <sys/lockf.h>
#ifdef AFS_AIX51_ENV
#include <sys/cred.h>
+#include <sys/pag.h>
#endif
#endif
#ifdef HAVE_UNISTD_H
curpag(void)
{
#if defined(AFS_AIX51_ENV)
- afs_int32 pag;
-
- if (get_pag(PAG_AFS, &pag) < 0 || pag == 0)
- pag = NOPAG;
- return pag;
+ int code = getpagvalue("afs");
+ if (code < 0 && errno == EINVAL)
+ code = 0;
+ return code;
#else
gid_t groups[NGROUPS_MAX];
afs_uint32 g0, g1;
#include <stdlib.h>
#ifdef AFS_AIX51_ENV
#include <sys/cred.h>
+#include <sys/pag.h>
#endif
RCSID
static afs_int32
curpag(void)
{
+#if defined(AFS_AIX51_ENV)
+ int code = getpagvalue("afs");
+ if (code < 0 && errno == EINVAL)
+ code = 0;
+ return code;
+#else
gid_t groups[NGROUPS_MAX];
afs_uint32 g0, g1;
afs_uint32 h, l, ret;
return -1;
}
return -1;
+#endif
}
/* Returns the AFS pag number, if any, otherwise return -1 */
#include <signal.h>
#ifdef AFS_AIX51_ENV
#include <sys/cred.h>
+#include <sys/pag.h>
+#include <errno.h>
#endif
#endif
#include <stdio.h>
curpag(void)
{
#if defined(AFS_AIX51_ENV)
- afs_int32 pag;
-
- if (get_pag(PAG_AFS, &pag) < 0 || pag == 0)
- pag = -1;
- return pag;
+ int code = getpagvalue("afs");
+ if (code < 0 && errno == EINVAL)
+ code = 0;
+ return code;
#else
afs_uint32 groups[NGROUPS_MAX];
afs_uint32 g0, g1;