Post B21soEiOO6LTPbJf8K by andrewrk@mastodon.social
 (DIR) More posts by andrewrk@mastodon.social
 (DIR) Post #B21soEiOO6LTPbJf8K by andrewrk@mastodon.social
       2026-01-07T03:27:56Z
       
       1 likes, 0 repeats
       
       C programmers struggle with the difference between an enum and a bit fieldif you work in the kernel, please get good, or use a better programming language, i don't care which
       
 (DIR) Post #B22Cy05vbCP22xG3vs by diegovsky@bolha.us
       2026-01-07T03:31:41Z
       
       0 likes, 0 repeats
       
       @andrewrk just making sure: doesn't the man page mean despite the fact you can combine them, it's an user error to do so?I don't know about this API but this is what I understood from the docs 🙃
       
 (DIR) Post #B22Cy1ao1shEh0iEhU by andrewrk@mastodon.social
       2026-01-07T03:42:56Z
       
       0 likes, 0 repeats
       
       @diegovsky that's correct, they've introduced an unnecessary invalid state
       
 (DIR) Post #B22Cy2WwXjCVbJufJo by wolf480pl@mstdn.io
       2026-01-07T07:31:54Z
       
       0 likes, 0 repeats
       
       @andrewrkwould you prefer sth like open(2), where the lower 2 bits of the flags field are an enum, while the rest is a bitfield? @diegovsky
       
 (DIR) Post #B22ScQJN2kjwFiHM1I by andrewrk@mastodon.social
       2026-01-07T10:26:02Z
       
       0 likes, 0 repeats
       
       @wolf480pl @diegovsky yes exactly. that's the more mathematically correct and economical way to model it
       
 (DIR) Post #B22VAvU7qbNGgntCc4 by wolf480pl@mstdn.io
       2026-01-07T10:55:57Z
       
       0 likes, 0 repeats
       
       @andrewrkhmm but you need some space for enum values you might add in the future, so you'll still have invalid statesAlso, it seems like it would make sense to use RENAME_WHITEOUT with RENAME_NOREPLACE, but not with RENAME_EXCHANGE.So if RENAME_WHITEOUT is a separate flag, how do you deal with WHITEOUT|EXCHANGE?  Does one of them win? Do you return EINVAL?@diegovsky
       
 (DIR) Post #B22e3ldswVhZiv7EJM by diegovsky@bolha.us
       2026-01-07T12:35:30Z
       
       0 likes, 0 repeats
       
       @wolf480pl @andrewrk that's what I thought too.I think you can do some combinations between all three but a specific one isn't allowed, like the man page mentions