metalsvm/newlib/net/socket.c

26 lines
398 B
C
Raw Normal View History

2011-07-11 13:30:05 +02:00
#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),
2011-07-11 14:20:49 +02:00
int domain _AND int type _AND int protocol)
2011-07-11 13:30:05 +02:00
{
int ret;
ret = SYSCALL3(__NR_socket, domain, type, protocol);
if (ret < 0) {
errno = -ret;
ret = -1;
}
return ret;
2011-07-11 14:20:49 +02:00
}