25 lines
398 B
C
25 lines
398 B
C
|
|
#include "config.h"
|
|
#include <_ansi.h>
|
|
#include <_syslist.h>
|
|
#include <errno.h>
|
|
#undef errno
|
|
extern int errno;
|
|
#include "warning.h"
|
|
#include "syscall.h"
|
|
|
|
|
|
int
|
|
_DEFUN (socket, (domain, type, protocol),
|
|
int domain _AND int type _AND int protocol)
|
|
{
|
|
int ret;
|
|
|
|
ret = SYSCALL3(__NR_socket, domain, type, protocol);
|
|
if (ret < 0) {
|
|
errno = -ret;
|
|
ret = -1;
|
|
}
|
|
|
|
return ret;
|
|
}
|