[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: LRNQWE3ABS.jpg (132 KB, 640x1867)
132 KB JPG
previous: >>108723814

#define __NR_setxattr                188
#define __NR_lsetxattr 189
#define __NR_fsetxattr 190
#define __NR_getxattr 191
#define __NR_lgetxattr 192
#define __NR_fgetxattr 193
#define __NR_listxattr 194
#define __NR_llistxattr 195
#define __NR_flistxattr 196
#define __NR_removexattr 197
#define __NR_lremovexattr 198
#define __NR_fremovexattr 199
#define __NR_setxattrat 463
#define __NR_getxattrat 464
#define __NR_listxattrat 465
#define __NR_removexattrat 466

https://man7.org/linux/man-pages/man7/xattr.7.html

tl;dr:
extended filesystem attributes

the manpage link above doesn't let you immediately jump to *every* xattr syscall manpage, but i believe that by now all of you should have figured out how to navigate the manpages on your own anyway. i believe in you!

basically, these let you set attributes on files (to include directories, etc.) in the form of atomic name:value pairs. the names can be further subdivided into classes, and these always form null-terminated strings. it seems like the value can be a mostly arbitrary length blob. of course, this means that querying for the length in order to allocate a buffer is inherently racy :^) yay linux!

anyone ever had a reason to use these before? i'm sure they're useful to someone, but that person isn't me

relevant resources:
man man

man syscalls

https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/
>>
I don't like xattr as a whole. It's one of those classic bolt-ons Linux is full of.
>>
>>108730420
tranny image
>>
>>108730546
OP is a literal tranny and it's honestly embarrassing he(she? hell if I know)'s responsible for the only high effort threads in the board
>>
>>108730827
Yeah, besides the discord-tier slop images (which desu is probably what causes 90% of people to click on the thread) this is one of the few good threads that doesn't instantly die because of the 40 generals and constant bait posts this board is comprised of.
>>
>>108731020
standard 4cuck experience. /g was fun and usefull for me during the first or second year of lurking, now there isnt much to learn from all the retards throwing shit at each other. its tiresome.
>>
>>108730420
i love u
>>
>>108730420
*xattr is one sexy syscall
>>
>>108730827
it's like this in FOSS and open source too, nerds who develop gender dysphoria happen to be the smartest and most motivated people.
>>
>>108730420
Fucking fairies.
>>
>>108732349
yes please
>>
>>108731129
ily2 anon
>>
sexattr
>>
>>108734136
with me?? >_<
>>
>>108730432
looks extremely retarded to me. Why do it like this instead of just adding for file `x` another file `x.metadata` and thus keep your filesystems much simpler?
>>
>>108734168
no unless fairy
>>
>>108734303
I've been called as much before
>>
>>108734190
literally the whole point is to not have to do that
it's not terribly implemented, it's just not particularly useful
>>
>>108734168
yes
>>
>>108734336
only way I can see this being useful is for certain user facing files, i.e. mp3 tagging. But then your xattrs must be portable accross filesystems
>>
>>108730420
>of course, this means that querying for the length in order to allocate a buffer is inherently racy :^) yay linux!
Just call it in a loop with a progressively larger buffer until it doesn't fail with ERANGE, starting with an expected sane size, if it fits you're done with a single syscall, otherwise realloc and retry.
>>
>getfattr
>>
File: 1777708687922.jpg (105 KB, 1060x891)
105 KB JPG
>>108730420
>yet another set of syscalls with a wrapper in binutils



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.