UNAME(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’– 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 variable UNAME_s is set, it will override the sysname member.
  • UNAME_r β€” If the environment variable UNAME_r is set, it will override the release member.
  • UNAME_v β€” If the environment variable UNAME_v is set, it will override the version member.
  • UNAME_m β€” If the environment variable UNAME_m is set, it will override the machine member.

πŸ’€ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms