From: guenther Date: Fri, 2 Aug 2024 22:14:54 +0000 (+0000) Subject: The {get,set}res[ug]id(2) family are in POSIX-2024's XSI option, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=04933f16a0805d1698bca8492afd01ebaec93212;p=openbsd The {get,set}res[ug]id(2) family are in POSIX-2024's XSI option, so adjust the #include visibility and update the manpage. ok millert@ --- diff --git a/include/unistd.h b/include/unistd.h index 04972072f96..4242ab01461 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.110 2024/08/02 01:53:21 guenther Exp $ */ +/* $OpenBSD: unistd.h,v 1.111 2024/08/02 22:14:54 guenther Exp $ */ /* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ /*- @@ -474,6 +474,12 @@ int unlinkat(int, const char *, int); #if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE int getentropy(void *, size_t); #endif +#if __XPG_VISIBLE >= 800 || __BSD_VISIBLE +int getresgid(gid_t *, gid_t *, gid_t *); +int getresuid(uid_t *, uid_t *, uid_t *); +int setresgid(gid_t, gid_t, gid_t); +int setresuid(uid_t, uid_t, uid_t); +#endif #if __BSD_VISIBLE int dup3(int, int, int); @@ -492,8 +498,6 @@ int getdomainname(char *, size_t) int getdtablecount(void); int getgrouplist(const char *, gid_t, gid_t *, int *); mode_t getmode(const void *, mode_t); -int getresgid(gid_t *, gid_t *, gid_t *); -int getresuid(uid_t *, uid_t *, uid_t *); pid_t getthrid(void); int getthrname(pid_t, char *, size_t); char *getusershell(void); @@ -523,8 +527,6 @@ int sethostname(const char *, size_t); int setlogin(const char *); void *setmode(const char *); int setpgrp(pid_t _pid, pid_t _pgrp); /* BSD compat version */ -int setresgid(gid_t, gid_t, gid_t); -int setresuid(uid_t, uid_t, uid_t); int setthrname(pid_t, const char *); void setusershell(void); int strtofflags(char **, u_int32_t *, u_int32_t *); diff --git a/lib/libc/sys/setresuid.2 b/lib/libc/sys/setresuid.2 index 7268f77caaf..43e2dde19df 100644 --- a/lib/libc/sys/setresuid.2 +++ b/lib/libc/sys/setresuid.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: setresuid.2,v 1.9 2015/09/10 17:55:21 schwarze Exp $ +.\" $OpenBSD: setresuid.2,v 1.10 2024/08/02 22:14:54 guenther Exp $ .\" .\" Copyright (c) 2000 .\" Sheldon Hearn. All rights reserved. @@ -21,7 +21,7 @@ .\" .\" $FreeBSD: src/lib/libc/sys/setresuid.2,v 1.12 2001/10/01 16:09:02 ru Exp $ .\" -.Dd $Mdocdate: September 10 2015 $ +.Dd $Mdocdate: August 2 2024 $ .Dt SETRESUID 2 .Os .Sh NAME @@ -31,7 +31,6 @@ .Nm setresuid .Nd get or set real, effective and saved user or group ID .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft int .Fn getresgid "gid_t *rgid" "gid_t *egid" "gid_t *sgid" @@ -89,10 +88,13 @@ was invalid. .Xr setreuid 2 , .Xr setuid 2 .Sh STANDARDS -These functions are not part of the -.St -p1003.1 -specification. -While they are not completely portable, they are the least ambiguous way to -manage user and group IDs. +The +.Fn getresgid , +.Fn getresuid , +.Fn setresgid , +and +.Fn setresuid +functions conform to the X/Open System Interfaces option of +.St -p1003.1-2024 . .Sh HISTORY These functions first appeared in HP-UX.