-/* $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 $ */
/*-
#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);
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);
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 *);
-.\" $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.
.\"
.\" $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
.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"
.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.