This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: socketpair missing in 2.0?


Andrew M Hoerter <amh@pobox.com> writes:

> Hi,
> 
> I'm porting an application to eCos (using 2.0 release) that makes use of
> the socketpair() call provided by the BSD TCP/IP stack.  This function is
> described in the eCos documentation, so I would think it's available, and
> indeed the prototype is obtained by including <network.h>; but at link
> time ld complains about an undefined reference to socketpair.  I'm using a
> very slightly modified form of the "net" configuration template as my .ecc
> configuration file, so I think my config is okay, but I'm open to
> suggestions there.
> 
> Grepping the eCos source tree didn't turn up anything that looked like an
> implementation of socketpair, either (aside from sys_socketpair?  Not sure
> of its significance).
> 
> Any ideas?  Something obvious I'm missing?
> 

socketpair() is really a generalization of the pipe() mechanism. Since
we had no need for pipes in eCos, socketpair() was left out too. Given
that the underlying implementation appears to still exist in the
TCP/IP stack, it would not be too difficult to add it. However, it is
probably of little utility to most users.

To do what you want -- break a select() out of its wait -- you could
use a signal to the waiting thread, or manufacture the equivalent of a
socketpair yourself through the localhost address. This latter is
probably only 20-odd lines of code.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]