getutmp(3)
β¨ getutmp(3) β¨
okay bestie, welcome to the Library Functions Manual π this one's short and sweet and it's literally just about copying structs around, no cap.
π NAME π
getutmp, getutmpx β copy a utmp structure to utmpx, and vice versa π¦
π LIBRARY π
Standard C library (libc, -lc) β the classic, the icon, the one you already linked π
πΈ SYNOPSIS πΈ
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <utmpx.h>
void getutmp(const struct utmpx *ux, struct utmp *u);
void getutmpx(const struct utmp *u, struct utmpx *ux);
heads up gorgeous: you need that #define _GNU_SOURCE line before the include, or these functions will ghost you π»
π DESCRIPTION π
so getutmp() takes the fields of the utmpx structure that ux is pointing at, and copies them over to the matching fields of the utmp structure that u is pointing at. like a little relay race but for struct fields πβοΈπ¨
and getutmpx()? she does the exact opposite. converse operation, main character energy, utmp β‘οΈ utmpx. periodt π
π RETURN VALUE π
these functions do not return a value. nothing. nada. they just do the thing and leave. honestly iconic behaviour ngl π«Ά
π ATTRIBUTES π
for what all these fancy words even mean, go peek at attributes(7), bestie.
getutmp(),getutmpx()β Thread safety:MT-Safeβ¨ (yes queen, safe to call from multiple threads, we love to see it)
β STANDARDS β
None. yep. nothing. not standardized anywhere, she's just out here living her life π
π¦ HISTORY π¦
- glibc
2.1.1β that's when she first showed up π± - Solaris, NetBSD β also vibing with these over there π
π NOTES π
lowkey the whole reason these two exist is compatibility with other systems, where the utmp and utmpx structures have different fields, or where the sizes of the corresponding fields differ. so you'd actually need a conversion. very giving "translator friend at a group hang" π§
but on Linux? plot twist β the two structures have the same fields, and those fields have the same sizes. so it's a copy that's basically a vibe check that always passes π
π SEE ALSO π
utmpdump(1), getutent(3), utmp(5) β go read those too, they're the friends in this friend group π
and that's the whole page, bestie!! this was from Linux man-pages 6.20, dated 2025-05-17, and it's the getutmp(3) page π mwah, go copy some structs responsibly π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms