-
copypaste
hello. im writing from rust libc project. i'm hoping to get comment on this:
rust-lang/libc #2914#issuecomment-1264351115
-
copypaste
essentially, there are no POSIX-conforming versions of getpwent_r and getgrent_r in illumos. i didn't notice this in 2017, and patched rust libc to refer to non-existent functions since CI passed (there are too many platforms to individually test)
-
copypaste
now that this issue has existed a while, i want to patch illumos to add the POSIX-conforming versions. there's a competing theory that rust-libc should change its API.
-
copypaste
what would illumos devs rather happen?
-
andyf
There should be POSIX-conforming versions available if the right standard is selected IIRC
-
andyf
I think illumos still defaults to POSIX.1c, Draft 6 for these, which is troublesome
-
andyf
-
andyf
-
andyf
I misremembered, I was thinking of getpwuid_r()
-
andyf
but what was done for that, could be done for getpwent_r and getgrent_r too (define __posix variants and select them based on the requested standard)
-
copypaste
andyf: is that the right solution though? as i see it there are two main things that can happen and i don't know which is worse
-
andyf
I can't actually find getpwent_r and getgrent_r in the POSIX standard
-
andyf
getpwnam_r and getpwuid_r are there
-
copypaste
i see, right, the original comment to rust/libc#2914 does say there are no conforming versions. but the versions assumed to be there in 2017 are really common.
-
copypaste
the issue is that in the man pages there are section called "Standard conforming"
-
copypaste
but i think actually there is no standard lol to which it is referring, man pages are wrong
-
andyf
The illumos man pages?
-
andyf
The linux ones seem to say "These functions are GNU extensions"
-
andyf
I don't know the history but it seems like Solaris and glibc evolved different variants of these.. which does not help you
-
copypaste
hmmm i thought i saw it in a bsd manpage
-
copypaste
(bsd does have the functions)
-
andyf
-
andyf
So getpwent(), getpwnam(), getpwnam_r(), getpwuid(), getpwuid_r(), setpwent(), and endpwent() are POSIX
-
copypaste
-
copypaste
right okay. well would you rather, then, that POSIX-like versions _not_ be added then?
-
copypaste
since it isn't right to call them conforming
-
copypaste
even if they are in linux, bsd
-
copypaste
-
copypaste
seems like Solaris and forks is the odd one out
-
andyf
It does, yes, and we always want to try and improve compatibility and make it easier to build things on illumos, which has meant adding GNU extensions and things in the past
-
copypaste
ok so maybe i should add them as e.g. __posixlike_getpwent_r
-
copypaste
and not __posix_getpwent_r
-
copypaste
and patch rust/libc as well
-
copypaste
that way it's clear that someething went wrong?
-
copypaste
or even __gnu or __bsd
-
copypaste
(dont really know the naming conventions)
-
andyf
I think we should try and do something, I'm just not sure what the best approach is (and the people who will have a better idea are probably still asleep)
-
andyf
we can define the symbol with any name that makes sense (just not __posix since it is not) - the tricky part is how software knows to select the different function definition
-
andyf
and how we stop breaking everything that knows about the illumos posix-draft-like variants
-
andyf
I have to head out for a bit but will be around later and this channel is usually more active then.
-
andyf
I'd summarise as. These are not POSIX, glibc and freebsd have grown posix-like variants which are different to the posix-like variants that we inherited from Solaris. How do we make things better for third party software?
-
copypaste
thanks andyf. can i post this log in the rust/libc issue?
-
yuripv
FWIW, i don't see any issues with tmux (3.3 though) after #14788, running debug
-
andyf
yuripv - in 3.3 they disabled event ports completely
-
andyf
-
andyf
If I rebuild tmux with that patch backed out, I see the problem that's reported in 15031
-
yuripv
ah, i see
-
yuripv
though the issue says it was that way for a long time?
-
andyf
Whatever it was that made them disable event ports in tmux seems to be a different issue, and I can't replicate it on current bits so perhaps it was fixed in the interim.
-
andyf
But since 3.3 is not using event ports, it does not get affected by 14788
-
richlowe
some of the discussion about this seems like it's going interesting places and maybe should land in a big comment in the code somewhere
-
richlowe
(unless all the bits that seem a bit odd get cleaned up)