STRUID(3ast) STRUID(3ast)

# [NAME](#NAME)

struid - return user ID number for given user name

# [SYNOPSIS](#SYNOPSIS)

int struid(const char* name)

# [DESCRIPTION](#DESCRIPTION)

*struid* returns the user ID number for the given user name. *struid* maintains an internal cache to avoid repeated password database scans by the low level [*getpwuid*(3)](/man/os/ksh/getpwuid.3). On the first error for a given name, *struid* returns -1. Subsequent errors for the same name will result in *struid* returning -2 instead.

# [SEE ALSO](#SEE_ALSO)

[getpwent(3)](/man/os/ksh/getpwent.3)

---

Document: struid(3ast) from ksh 1.0.10-r37 (Chainguard OS)
Source: https://github.com/ksh93/ksh
