we have pid_t and gid_t and uid_t but no fd_t

they're all ints why did fds get left out of the typedef club qwq
@navi we have errno_t as well and nobody uses it ever
@humm it's part of annex K iirc and things just don't implement annex K at all

but yeah returning errno_t instead of 'int' would be a lot better

@navi @humm Why do yall think that the multiplication of integer types is a good thing?

It's boilerplate, it makes the code less clear, it bloats header files, and if I need to serialize it I need to add a sysdep test to know what size it is. And the benefits of having specific integer types are dubious at best, I've never seen a strong argument for them.

What makes you want fd_t and errno_t over int or, if anything, int32_t?

@ska @navi @humm honestly i'd be for it if itd disallow arithmetic operations (when's the last time it made sense to multiply a file descriptor ?), but it doesn't

on the otherhand, it just seems silly to have some have a typedef and some not

imo there shouldn't be any of those, but, hey

@SRAZKVT @ska @humm

i'd like function signatures to be more self-descriptive, not less
@navi @humm @ska sure, me too, but i'd also rather have a type that disallows useless operations for those, or for everything to be consistent and at least all be typedef'd
@SRAZKVT @humm @ska

oh, yes, having it be properly a new type instead of an alias would be great -- and i think celeste even proposed that to wg14, a "stronger" kind of typedef

dunno how that went tho

@SRAZKVT
>when's the last time it made sense to multiply a file descriptor ?

you get a file descriptor as a decimal number string, you transform it to int by repeatedly multiplying it by 10 and adding digits

@ska @navi

@humm @ska @navi yes for special cases like this you should be able to extract and replace the actual int, but it should be explicit

my point is that code like open(...) * 3 is semantic nonsense and shouldn't be allowed