source: rtems/cpukit/libnetworking/rtems/rtems_socketpair.c @ fe5ecbb

4.104.114.95
Last change on this file since fe5ecbb was 6f57450, checked in by Joel Sherrill <joel.sherrill@…>, on 09/21/07 at 15:34:10

2007-09-21 Joel Sherrill <joel.sherrill@…>

  • libnetworking/Makefile.am: Add dummy socketpair() implementation to document what is required to provide a fully functional implementation.
  • libnetworking/rtems/rtems_socketpair.c: New file.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  socketpair() for RTEMS
3 *
4 *  This file exists primarily to document what is required to provide
5 *  a functional implementation of socketpair() for RTEMS.
6 *
7 *  The socketpair() service requires that the "local domain" sockets
8 *  be functional.  This is denoted by the domain constants AF_LOCAL
9 *  and AF_UNIX and the protocol constants PF_LOCAL and PF_UNIX.  The
10 *  local domain functionality is implemented in the file kern/uipc_usrreq.c
11 *  which was not part of the initial port of the FreeBSD stack to
12 *  RTEMS. 
13 *
14 *  The FreeBSD socketpair implementation appears to be dependent on
15 *  file system features which are not available currently in RTEMS.
16 * 
17 *  COPYRIGHT (c) 1989-2007.
18 *  On-Line Applications Research Corporation (OAR).
19 *
20 *  The license and distribution terms for this file may be
21 *  found in the file LICENSE in this distribution or at
22 *  http://www.rtems.com/license/LICENSE.
23 *
24 *  $Id$
25 */
26
27#if HAVE_CONFIG_H
28#include "config.h"
29#endif
30
31#include <unistd.h>
32#include <sys/socket.h>
33#include <sys/errno.h>
34
35int socketpair (int domain, int type, int protocol, int *rsv)
36{
37  if ( !rsv ) {
38    errno = EFAULT;
39    return -1;
40  }
41
42  /*
43   *  Yes, we do not support socketpair() so this is really paranoid.
44   *  But it ensures that someone calling this routine and ignoring
45   *  the return status will get errors from subsequent socket calls.
46   */
47  rsv[ 0 ] = -1;
48  rsv[ 1 ] = -1;
49  errno = ENOSYS;
50  return -1;
51}
Note: See TracBrowser for help on using the repository browser.