From: "David Reid" <dreid@xxxxxxxxxxxx> > > Yes, but not R5 sockets. > > We'd need to have a device that maps all calls, e.g. /dev/socket - > > every time an application calls socket(), that fake device would create > > a new sockets, but it would have a real fd then. > > We'd need port communication between the device and the net_server, > > then. > > Taking a leap here, is this something close to what you were referring? > > - socket module creates/manages the /dev/[net/]socket device when dev_init > is called. > - when the userland app links against libsocket they basically get a routine > that opens /dev/[net]/socket and get a real fd from hte system which thinks > it's just a file > - because it's a file system entry presumably we can tell the system which > functions to call for read/write and ioctl? > > Does that make sense? Is this something like what you were thinking Axel? > If it is is there any code to look at out there that does similar things? I am not really sure how fds are managed (i.e. how they are created/destroyed), but I guess that if we are really able to associate an fd with a socket call (being it via /dev/socket or whatever) the implementation of everything else should be straight forward. There is only one caveat I can think of... The select() call. If I am not mistaken, select() does not work on file descriptors (or is it sockets) in BeOS R5. I am not sure if we can change that by rolling out our own select() implementation... Where is it implemented in BeOS? libroot.so? -Bruno