From 2b3e9d9b244e279ef5693a7cf5dacc7903164af5 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Mon, 22 Jul 2002 09:46:48 +0000 Subject: Remove, moved to cpukit. --- c/src/exec/libcsupport/src/libio_sockets.c | 75 ------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 c/src/exec/libcsupport/src/libio_sockets.c (limited to 'c/src/exec/libcsupport/src/libio_sockets.c') diff --git a/c/src/exec/libcsupport/src/libio_sockets.c b/c/src/exec/libcsupport/src/libio_sockets.c deleted file mode 100644 index a1e98c8b0a..0000000000 --- a/c/src/exec/libcsupport/src/libio_sockets.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file contains the support infrastructure used to manage the - * table of integer style file descriptors used by the socket calls. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* libio_.h pulls in rtems */ -#include - -#include - -/* - * Convert an RTEMS file descriptor to a BSD socket pointer. - */ - -struct socket *rtems_bsdnet_fdToSocket( - int fd -) -{ - rtems_libio_t *iop; - - /* same as rtems_libio_check_fd(_fd) but different return */ - if ((unsigned32)fd >= rtems_libio_number_iops) { - errno = EBADF; - return NULL; - } - iop = &rtems_libio_iops[fd]; - - /* same as rtems_libio_check_is_open(iop) but different return */ - if ((iop->flags & LIBIO_FLAGS_OPEN) == 0) { - errno = EBADF; - return NULL; - } - - if (iop->data1 == NULL) - errno = EBADF; - return iop->data1; -} - -/* - * Create an RTEMS file descriptor for a socket - */ - -int rtems_bsdnet_makeFdForSocket( - void *so, - const rtems_filesystem_file_handlers_r *h -) -{ - rtems_libio_t *iop; - int fd; - - iop = rtems_libio_allocate(); - if (iop == 0) { - errno = ENFILE; - return -1; - } - fd = iop - rtems_libio_iops; - iop->flags |= LIBIO_FLAGS_WRITE | LIBIO_FLAGS_READ; - iop->data0 = fd; - iop->data1 = so; - iop->handlers = (rtems_filesystem_file_handlers_r *) h; - return fd; -} -- cgit v1.2.3