1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)getuid.2 8.1 (Berkeley) 06/04/93 7.\" 8.Dd 9.Dt GETUID 2 10.Os BSD 4 11.Sh NAME 12.Nm getuid , 13.Nm geteuid 14.Nd get user identification 15.Sh SYNOPSIS 16.Fd #include <unistd.h> 17.Fd #include <sys/types.h> 18.Ft uid_t 19.Fn getuid void 20.Ft uid_t 21.Fn geteuid void 22.Sh DESCRIPTION 23The 24.Fn getuid 25function returns the real user ID of the calling process. 26The 27.Fn geteuid 28function 29returns the effective user ID of the calling process. 30.Pp 31The real user ID is that of the user who has invoked the program. 32As the effective user ID 33gives the process additional permissions during 34execution of 35.Dq Em set-user-ID 36mode processes, 37.Fn getuid 38is used to determine the real-user-id of the calling process. 39.Sh ERRORS 40The 41.Fn getuid 42and 43.Fn geteuid 44functions are always successful, and no return value is reserved to 45indicate an error. 46.Sh SEE ALSO 47.Xr getgid 2 , 48.Xr setreuid 2 49.Sh STANDARDS 50.Fn Geteuid 51and 52.Fn getuid 53conform to IEEE Std 1003.1-1988 54.Pq Dq Tn POSIX . 55