linux-mips-fnet
[Top] [All Lists]

Re: SOCK_STREAM definition

To: "Bradley D. LaRonde" <brad@ltc.com>, <linux-mips@vger.rutgers.edu>, <linux-mips@fnet.fr>
Subject: Re: SOCK_STREAM definition
From: Andreas Jaeger <aj@suse.de>
Date: 13 Mar 2000 16:07:59 +0100
In-reply-to: "Bradley D. LaRonde"'s message of "Sun, 12 Mar 2000 20:32:22 -0500"
References: <XFMail.000312222334.Harald.Koerfgen@home.ivm.de> <0b2401bf8c8b$fb341320$b8119526@ltc.com>
Sender: aj@suse.de
User-agent: Gnus/5.0804 (Gnus v5.8.4) XEmacs/21.1 (Bryce Canyon)
>>>>> 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
 > libc.".

 > 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.  */
enum __socket_type
{
  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.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

<Prev in Thread] Current Thread [Next in Thread>