cuserid3
Get user name associated with effective uid
Usage
char *
Library
library “libcompat”
Overview
The cuserid() function is made obsolete by getpwuid(3).
The function cuserid() gets the user name associated with the effective UID of the current process. If the argument s is non-NULL, the name is copied to the buffer it points to, and that address is being returned. This buffer must provide space for at least L_cuserid characters. The L_cuserid constant is defined in ⟨stdio.h⟩.
If s is NULL, an internal array is used and its address will be returned.
Return values
The cuserid() function returns the address of an array in which the name has been stored.
If the name associated with the effective UID of the current process could not be found, either a null pointer will be returned, or (if s is non-NULL) the buffer s will be filled with a null string.
History
- FreeBSD 16.0-CURRENT (2026-10-27) to FreeBSD 13.3-RELEASE: the text shown here
- FreeBSD 13.2-RELEASE to FreeBSD 13.0-RELEASE
- FreeBSD 12.4-RELEASE
- FreeBSD 12.3-RELEASE
- FreeBSD 12.2-RELEASE
- FreeBSD 12.1-RELEASE
- FreeBSD 12.0-RELEASE
- FreeBSD 11.4-RELEASE
- FreeBSD 11.3-RELEASE
- FreeBSD 11.2-RELEASE
- FreeBSD 11.1-RELEASE
- FreeBSD 11.0-RELEASE
- FreeBSD 10.4-RELEASE
- FreeBSD 10.3-RELEASE
- FreeBSD 10.2-RELEASE
- FreeBSD 10.1-RELEASE
- FreeBSD 10.0-RELEASE
- FreeBSD 9.3-RELEASE
- FreeBSD 9.2-RELEASE
- FreeBSD 9.1-RELEASE
- FreeBSD 9.0-RELEASE
- FreeBSD 8.4-RELEASE
- FreeBSD 8.3-RELEASE
- FreeBSD 8.2-RELEASE
- FreeBSD 8.1-RELEASE
- FreeBSD 8.0-RELEASE
- FreeBSD 7.4-RELEASE
- FreeBSD 7.3-RELEASE
- FreeBSD 7.2-RELEASE
- FreeBSD 7.1-RELEASE
- FreeBSD 7.0-RELEASE
- FreeBSD 6.4-RELEASE
- FreeBSD 6.3-RELEASE to FreeBSD 5.3-RELEASE
- FreeBSD 5.2.1-RELEASE to FreeBSD 5.2-RELEASE
- FreeBSD 5.1-RELEASE
- FreeBSD 5.0-RELEASE
- FreeBSD 4.11-RELEASE to FreeBSD 4.5-RELEASE
- FreeBSD 4.4-RELEASE
- FreeBSD 4.3-RELEASE
- FreeBSD 4.2-RELEASE to FreeBSD 4.0-RELEASE
- FreeBSD 3.5.1-RELEASE to FreeBSD 3.3-RELEASE
- FreeBSD 3.2-RELEASE to FreeBSD 3.0-RELEASE
- FreeBSD 2.2.9-RELEASE
- FreeBSD 2.2.8-RELEASE to FreeBSD 2.2.2-RELEASE
- FreeBSD 2.1.7.1-RELEASE to FreeBSD 2.1.5-RELEASE
- FreeBSD 2.0.5-RELEASE