Discussion:
s6-linux-utils
Jorge Almeida
2012-09-05 13:48:46 UTC
Permalink
Laurent,

I tried (again) to compile it against dietlibc, and this time I succeded
after a small manual intervention: make complained (on devd.c) about
undefined SO_RCVBUFFORCE (line 45). I substituted SO_RCVBUFFORCE by 33
and it worked. I fished the value 33 from
/usr/include/asm-generic/socket.h
I couldn't find a definition of SO_RCVBUFFORCE anywhere else. Where
should it be? Reading the includes in devd.c one wouldn't guess
asm-generic/socket.h. And is it safe to just use the value 33?

Thanks,

Jorge Almeida
Laurent Bercot
2012-09-05 15:17:30 UTC
Permalink
Post by Jorge Almeida
I tried (again) to compile it against dietlibc, and this time I succeded
after a small manual intervention: make complained (on devd.c) about
undefined SO_RCVBUFFORCE (line 45). I substituted SO_RCVBUFFORCE by 33
and it worked. I fished the value 33 from
/usr/include/asm-generic/socket.h
I couldn't find a definition of SO_RCVBUFFORCE anywhere else.
Hi Jorge,
On glibc and uClibc, sys/socket.h includes bits/socket.h, which
includes asm/socket.h, which includes asm-generic/socket.h.
So "#include <sys/socket.h>" should just work. No userland program
should ever have to include kernel or asm headers ! If you have to
do that, it's a bug in the libc.

The diet libc's headers have a different, simpler, structure. They
might be missing a few SO_* definitions; until Felix adds them (and
I'm not holding my breath), the simplest workaround is indeed to
define them by hand. When he does add them, it will probably be in
sys/socket.h directly, so the current s6-devd.c code will work.
Post by Jorge Almeida
And is it safe to just use the value 33?
33 seems to be the magic number used by the Linux kernel implementation
of setsockopt() for SO_RCVBUFFORCE. I wouldn't hardcode 33, but it's
unlikely to change in the foreseeable future.
--
Laurent
Jorge Almeida
2012-09-05 17:18:54 UTC
Permalink
Post by Laurent Bercot
Post by Jorge Almeida
I tried (again) to compile it against dietlibc, and this time I succeded
after a small manual intervention: make complained (on devd.c) about
undefined SO_RCVBUFFORCE (line 45). I substituted SO_RCVBUFFORCE by 33
and it worked. I fished the value 33 from
/usr/include/asm-generic/socket.h
I couldn't find a definition of SO_RCVBUFFORCE anywhere else.
Hi Jorge,
On glibc and uClibc, sys/socket.h includes bits/socket.h, which
includes asm/socket.h, which includes asm-generic/socket.h.
So "#include <sys/socket.h>" should just work. No userland program
should ever have to include kernel or asm headers ! If you have to
do that, it's a bug in the libc.
The diet libc's headers have a different, simpler, structure. They
might be missing a few SO_* definitions; until Felix adds them (and
I'm not holding my breath), the simplest workaround is indeed to
define them by hand. When he does add them, it will probably be in
sys/socket.h directly, so the current s6-devd.c code will work.
Post by Jorge Almeida
And is it safe to just use the value 33?
33 seems to be the magic number used by the Linux kernel implementation
of setsockopt() for SO_RCVBUFFORCE. I wouldn't hardcode 33, but it's
unlikely to change in the foreseeable future.
Understood. I'll post to the diet list.

BTW: conf-compile/{path-include,path-library} refer to execline stuff.
However, execline is not listed as a dependency in
http://www.skarnet.org/software/s6-linux-utils/install.html

Thanks,

Jorge
Laurent Bercot
2012-09-06 04:26:06 UTC
Permalink
Post by Jorge Almeida
BTW: conf-compile/{path-include,path-library} refer to execline stuff.
However, execline is not listed as a dependency in
http://www.skarnet.org/software/s6-linux-utils/install.html
Thanks for the report. It's a bug in conf-compile/ and you can safely
remove the execline-related lines. No s6-linux-utils program depends on
execline.
--
Laurent
Loading...