Merge 1.8.0~pre4 packaging into master
[pkg-k5-afs_openafs.git] / src / afs / HPUX / osi_misc.c
blobc80bf6a78e264d66b99f4f3a25caa96ef6cd581e
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 */
11 * Implements:
12 * afs_suser
15 #include <afsconfig.h>
16 #include "afs/param.h"
19 #include "afs/sysincludes.h" /* Standard vendor system headers */
20 #include "afsincludes.h" /* Afs-based standard headers */
23 * afs_suser() returns true if the caller is superuser, false otherwise.
25 * Note that it must NOT set errno.
27 * Here we have to save and restore errno since the HP-UX suser() sets errno.
30 afs_suser(void *credp)
32 int save_errno;
33 int code;
35 save_errno = u.u_error;
36 code = suser();
37 u.u_error = save_errno;
39 return code;