Discussion:
missing(?) headers
Jorge Almeida
2012-09-05 17:34:59 UTC
Permalink
Felix,

dietlibc doesn't provide the definition of SO_RCVBUFFORCE, which for glibc is
found in /usr/include/asm-generic/socket.h. This constant is needed to compile
s6-linux-utils. (I already posted to the skaware list.) Would you add the
headers, or otherwise suggest a clean solution?

TIA

Jorge Almeida
Felix von Leitner
2012-09-05 20:51:02 UTC
Permalink
Post by Jorge Almeida
dietlibc doesn't provide the definition of SO_RCVBUFFORCE, which for glibc is
found in /usr/include/asm-generic/socket.h. This constant is needed to compile
s6-linux-utils. (I already posted to the skaware list.) Would you add the
headers, or otherwise suggest a clean solution?
asm-generic is not part of glibc. Those are kernel headers.
I suggest using the kernel headers for now.
I never even heard of the s6-linux-utils :-)

Felix
Jorge Almeida
2012-09-05 22:22:04 UTC
Permalink
On Wed, Sep 5, 2012 at 9:51 PM, Felix von Leitner
Post by Felix von Leitner
Post by Jorge Almeida
dietlibc doesn't provide the definition of SO_RCVBUFFORCE, which for glibc is
found in /usr/include/asm-generic/socket.h. This constant is needed to compile
s6-linux-utils. (I already posted to the skaware list.) Would you add the
headers, or otherwise suggest a clean solution?
asm-generic is not part of glibc. Those are kernel headers.
Yap. My bad.
Post by Felix von Leitner
I suggest using the kernel headers for now.
I never even heard of the s6-linux-utils :-)
http://www.skarnet.org/software/s6-linux-utils/

Well, it was worth the try :)

Thanks

Jorge
Laurent Bercot
2012-09-06 04:36:16 UTC
Permalink
Post by Felix von Leitner
asm-generic is not part of glibc. Those are kernel headers.
I suggest using the kernel headers for now.
Hi Felix,

So glibc and uClibc are #including some kernel headers at some point,
if only to get SO_* definitions.
What is your policy about #including kernel headers in the diet libc's
headers, so userland programs don't have to ?
(My view is that a userland program should never have to #include
kernel headers directly.)
Post by Felix von Leitner
I never even heard of the s6-linux-utils :-)
Until recently, there was no reason to. There was nothing in there
that couldn't be done with your embutils.
However, you might want to take a look now: you might like s6-devd.
--
Laurent
Felix von Leitner
2012-09-06 15:12:32 UTC
Permalink
Post by Laurent Bercot
Post by Felix von Leitner
asm-generic is not part of glibc. Those are kernel headers.
I suggest using the kernel headers for now.
So glibc and uClibc are #including some kernel headers at some point,
if only to get SO_* definitions.
What is your policy about #including kernel headers in the diet libc's
headers, so userland programs don't have to ?
(My view is that a userland program should never have to #include
kernel headers directly.)
In the beginning I included kernel headers as well, but then I asked
Linus on the kernel mailing list and he said he does not want user space
to include kernel headers, period, so I stopped doing it.

Still, several projects do it, so I'm taking some precautions so that
that still works.

All the SO_* defines should be in <sys/socket.h>, am I right?
Post by Laurent Bercot
Post by Felix von Leitner
I never even heard of the s6-linux-utils :-)
Until recently, there was no reason to. There was nothing in there
that couldn't be done with your embutils.
However, you might want to take a look now: you might like s6-devd.
OK, will have a look.

Felix
Johannes Stezenbach
2012-09-06 16:01:01 UTC
Permalink
Post by Felix von Leitner
Post by Laurent Bercot
Post by Felix von Leitner
asm-generic is not part of glibc. Those are kernel headers.
I suggest using the kernel headers for now.
So glibc and uClibc are #including some kernel headers at some point,
if only to get SO_* definitions.
What is your policy about #including kernel headers in the diet libc's
headers, so userland programs don't have to ?
(My view is that a userland program should never have to #include
kernel headers directly.)
In the beginning I included kernel headers as well, but then I asked
Linus on the kernel mailing list and he said he does not want user space
to include kernel headers, period, so I stopped doing it.
Nowadays Linux has a headers_install target which cleans up
the kernel headers for use by userspace.

Johannes
Laurent Bercot
2012-09-06 15:11:23 UTC
Permalink
Post by Johannes Stezenbach
Nowadays Linux has a headers_install target which cleans up
the kernel headers for use by userspace.
Ah, so that's it. Sounds like a reasonable approach.
--
Laurent
Laurent Bercot
2012-09-06 15:10:07 UTC
Permalink
Post by Felix von Leitner
In the beginning I included kernel headers as well, but then I asked
Linus on the kernel mailing list and he said he does not want user space
to include kernel headers, period, so I stopped doing it.
I heard of it, and I assumed he meant "user space programs", with a
special exception for the libc...
As of today, glibc and uClibc still include asm-generic/socket.h at
some point in sys/socket.h. Why isn't Linus yelling at them ?
Post by Felix von Leitner
All the SO_* defines should be in <sys/socket.h>, am I right?
Yes, that's what userland programs include to get those definitions.
--
Laurent
Loading...