seteuid() and setegid() were adopted in IEEE Std 1003.1-2001 + X/Open

portability guide issue 6, adjust headers to expose the function
prototypes with appropriate _POSIX_C_SOURCE/_XOPEN_SOURCE defines
fixes standards/21136 by MAEKAWA Masahide
This commit is contained in:
jdolecek 2003-04-14 08:12:11 +00:00
parent dbb7ed96ba
commit e75e2e6438
2 changed files with 12 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.88 2001/07/29 22:18:45 wiz Exp $ */
/* $NetBSD: unistd.h,v 1.89 2003/04/14 08:12:11 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -161,6 +161,14 @@ extern int optind;
extern int optopt;
#endif
/*
* IEEE Std 1003.1-2001, adopted in X/Open Portability Guide Issue 6 and later
*/
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
(_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
int setegid __P((gid_t));
int seteuid __P((uid_t));
#endif
/*
* The following three syscalls are also defined in <sys/types.h>
@ -329,8 +337,6 @@ int revoke __P((const char *));
int rresvport __P((int *));
int ruserok __P((const char *, int, const char *, const char *));
int setdomainname __P((const char *, size_t));
int setegid __P((gid_t));
int seteuid __P((uid_t));
int setgroups __P((int, const gid_t *));
int sethostid __P((long));
int sethostname __P((const char *, size_t));

View File

@ -1,4 +1,4 @@
.\" $NetBSD: setuid.2,v 1.14 2003/01/18 11:33:13 thorpej Exp $
.\" $NetBSD: setuid.2,v 1.15 2003/04/14 08:12:12 jdolecek Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -124,13 +124,5 @@ The
.Fn seteuid
and
.Fn setegid
functions are extensions based on the
.Tn POSIX
concept of
.Li _POSIX_SAVED_IDS ,
and have been proposed for a future revision of the standard.
They provide the same feature of toggling effective IDs as
.Li _POSIX_SAVED_IDS ,
but do so independent of the current effective
ID, rather than requiring the super-user to permanently revoke its
privileges.
functions are compliant with the
.St -p1003.1-2001 .