On Thu, Apr 27, 2017 at 06:40:00AM +0100, Daniel Silverstone wrote:
On Wed, Apr 26, 2017 at 21:59:35 +0100, Richard Ipsum wrote:
> I couldn't find mention of thread safety in the FreeBSD man page for
> readdir, and Solaris's man page says it's unsafe.
> We can just #ifdef if that's what you'd prefer, I don't know how
important
> maintaining thread safety on BSDs and Solaris is to you.
At least for now, maintaining the current capabilities are more important
to me than eliminating warnings about possible future deprecation on one
platform.
Fair enough
> One thing that just occurred to me is since it is possible on some platforms
> that d_name may not be null-terminated when the length of the name exceeds
> NAME_MAX, then the existing code might be broken anyway since lua_pushstring
> expects a null terminated string and luxio doesn't check whether the string
> is null terminated or not before passing it.
>
> What do you think?
I think this null-termination thing is way more interesting to me as a bugfix/patch
than the warning cleanup. If Nix requires that everything compiles warning-free then
they're going to be in an interesting position every time the compiler or libc
update.
NixOS doesn't, as far as I'm aware, require builds to be warning-free.
I'd very much like to see a patch resolving what you see as the issue regarding
a name exceeding NAME_MAX. TBH I'd be quite satisfied with something which
caused an error return if the d_name array lacked a terminator, though if you
can come up with something which can recover things, that'd be awesome too.
I think this might be related to
https://trello.com/c/BeeWV4Ej/50
Okay I'll look into it.
In the meantime, I've filed
https://trello.com/c/yGjQipfG/52 related to readdir_r()
Cool
Thanks,
Richard