>>>>> Bradley D LaRonde writes:
> Using kernel 2.3.47. SOCK_STREAM is not defined anywhere my
> /usr/mipsel-linux/include. The only place I can find it is in
> asm-mips/socket.h, but there it is protected by #ifdef __KERNEL__. That
> #ifdef is relatively new, put in CVS on 2000/02/25 with comment "Bits for
> So what is the correct way to get SOCK_STREAM to userland?
They should be defined in <socketbits.h> - but apparently they aren't.
Here's the definition, just add it to <socketbits.h>:
/* Types of sockets. */
SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
of fixed maximum length. */
#define SOCK_DGRAM SOCK_DGRAM
SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
byte streams. */
#define SOCK_STREAM SOCK_STREAM
SOCK_RAW = 3, /* Raw protocol interface. */
#define SOCK_RAW SOCK_RAW
SOCK_RDM = 4, /* Reliably-delivered messages. */
#define SOCK_RDM SOCK_RDM
SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
datagrams of fixed maximum length. */
#define SOCK_SEQPACKET SOCK_SEQPACKET
SOCK_PACKET = 10 /* Linux specific way of getting packets
at the dev level. For writing rarp and
other similar things on the user level. */
#define SOCK_PACKET SOCK_PACKET
This is a bug in the MIPS glibc 2.0.x package.
I've asked Ralf to add an #ifdef __KERNEL__ for asm/socket.h - but
this is not the final solution AFAIK. No architecture (except MIPS)
export SOCK_STREAM etc to userspace from the kernel.
This will work with the glibc I'm working on - and it will work the
same way as for other architectures.
SuSE Labs email@example.com