UNAME(3)
π uname(3) π
okay so this is the uname(3) page from the Library Functions Manual, and itβs literally all about getting system identification. grab a strawberry π and letβs get into it, bestie.
β¨ NAME β¨
uname β get system identification
π LIBRARY π
Standard C Library (libc, -lc) β yes bestie, thatβs the one.
π οΈ SYNOPSIS π οΈ
#include <sys/utsname.h>
int
uname(struct utsname *name);
πΈ DESCRIPTION πΈ
The uname() function stores NUL-terminated strings of information identifying the current system into the structure referenced by name. NUL, not NULL β weβre being precise, periodt π
The utsname structure is defined in the <sys/utsname.h> header file, and contains the following members:
sysnameβ Name of the operating system implementation.nodenameβ Network name of this machine.releaseβ Release level of the operating system.versionβ Version level of the operating system.machineβ Machine hardware platform.
π RETURN VALUES π
The uname() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. thatβs the whole deal, no cap β¨
π ENVIRONMENT π
these env vars can override the struct members, and if theyβre set, they win:
UNAME_sβ If the environment variableUNAME_sis set, it will override thesysnamemember.UNAME_rβ If the environment variableUNAME_ris set, it will override thereleasemember.UNAME_vβ If the environment variableUNAME_vis set, it will override theversionmember.UNAME_mβ If the environment variableUNAME_mis set, it will override themachinemember.
π ERRORS π
The uname() function may fail and set errno for any of the errors specified for the library functions sysctl(3). so if something goes sideways, go read that page, bestie π«Ά
π SEE ALSO π
β STANDARDS β
The uname() function conforms to IEEE Std 1003.1-1988 (βPOSIX.1β). standards slay π
π¦ HISTORY π¦
The uname() function first appeared in 4.4BSD. vintage icon behavior, honestly π
mwah π β this page is from the Debian edition, dated December 2, 2005. thatβs the source/version and date, and now weβre done, bestie π«Ά
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1994 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms