Print this page
9704 move socket functions to libc
*** 35,57 ****
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stropts.h>
#include <sys/stream.h>
#include <sys/socketvar.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
! extern int _socket_create(int, int, int, int);
! extern int _so_socketpair(int*);
int _socketpair_create(int, int, int, int*, int);
#pragma weak socketpair = _socketpair
--- 35,55 ----
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stropts.h>
#include <sys/stream.h>
#include <sys/socketvar.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
! extern int _so_socket(int, int, int, dev_t, int);
! extern int _so_socketpair(int *);
int _socketpair_create(int, int, int, int*, int);
#pragma weak socketpair = _socketpair
*** 92,105 ****
/*
* Create the two sockets and pass them to _so_socketpair, which
* will connect them together.
*/
! fd1 = _socket_create(family, type, protocol, version);
if (fd1 < 0)
return (-1);
! fd2 = _socket_create(family, type, protocol, version);
if (fd2 < 0) {
int error = errno;
(void) close(fd1);
errno = error;
--- 90,103 ----
/*
* Create the two sockets and pass them to _so_socketpair, which
* will connect them together.
*/
! fd1 = _so_socket(family, type, protocol, NULL, version);
if (fd1 < 0)
return (-1);
! fd2 = _so_socket(family, type, protocol, NULL, version);
if (fd2 < 0) {
int error = errno;
(void) close(fd1);
errno = error;