mount_attr(2type)
π mount_attr(2type) β the struct that tells the kernel what to change π
okay so bestie, this is a 2type page, meaning it documents a type (a struct, not a function), and the whole vibe is: "here's the lil box of fields you hand to the kernel so it knows what mount properties to set, clear, and how to propagate". It lives in the Linux kernel headers, so no linking required, she's just a definition. π
β¨ NAME β¨
mount_attr β what mount properties to set and clear
π LIBRARY π
Linux kernel headers
ngl this one's not a lib you link against, it's a header situation. include and go. π«Ά
πΈ SYNOPSIS πΈ
#include <sys/mount.h>
struct mount_attr {
u64 attr_set; /* Mount properties to set */
u64 attr_clr; /* Mount properties to clear */
u64 propagation; /* Mount propagation type */
u64 userns_fd; /* User namespace file descriptor */
/* ... */
};
π DESCRIPTION π
Okay so the whole "it's giving" of this struct is: it spells out which mount properties should be changed when you call mount_setattr(2). That's it, that's the job. β¨
The fields are as follows, no skips, we're reading all of them:
.attr_setβ this field says whichMOUNT_ATTR_*attribute flags to set. π.attr_clrβ this field says whichMOUNT_ATTR_*attribute flags to clear. bye bestie π.propagationβ this field says what mount propagation will be applied. The valid values here are the same propagation types described inmount_namespaces(7). So if you wanna know your options, that's your girl. π¦.userns_fdβ this field is a file descriptor that indicates which user namespace to use as a reference for ID-mapped mounts withMOUNT_ATTR_IDMAP. very main character, very specific. π
β STANDARDS β
Linux. periodt. π§
π°οΈ HISTORY π°οΈ
- Linux 5.12. β
- glibc 2.36. β¨
π¨ IMPORTANT WARNING, FR FR π¨ Extra fields may be appended to the structure, and a zero value in a new field makes the kernel behave as though that extension field was not present. So a user must zero-fill this structure on initialization. No cap β if you don't zero-fill it, you're gambling and the kernel does not play. π
π SEE ALSO π
and that's the whole page bestie, you ate that π β¨
okay bye, this was Linux man-pages 6.20, dated 2025-09-21 β love her, respect her, zero-fill your structs. ππ¦π
π¦ 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