Commit 6397c744 authored by Danilo Sabato's avatar Danilo Sabato Committed by Alessandro Rubini

arch-bare-linux: added two syscalls (close and setsockopt)

parent dff20072
......@@ -32,7 +32,9 @@ extern int sys_bind(int fd, const struct bare_sockaddr *addr, int addrlen);
extern int sys_recv(int fd, void *pkt, int plen, int flags);
extern int sys_send(int fd, void *pkt, int plen, int flags);
extern int sys_shutdown(int fd, int flags);
extern int sys_close(int fd);
extern int sys_setsockopt(int fd, int level, int optname, const void *optval,
int optlen);
extern int sys_gettimeofday(void *tv, void *z);
extern int sys_settimeofday(void *tv, void *z);
extern int sys_adjtimex(void *tv);
......
......@@ -28,6 +28,7 @@ _syscall2(int, gettimeofday, void *, tv, void *,z);
_syscall2(int, settimeofday, void *, tv, void *,z);
_syscall1(int, adjtimex, void *, tv);
_syscall2(int, clock_gettime, int, clock, void *, t);
_syscall1(int, close, int, fd);
/*
* In the bare arch I'd better use sys_ prefixed names
......@@ -40,6 +41,8 @@ int sys_time(int tz)
__attribute__((alias("time")));
int sys_ioctl(int fd, int cmd, void *arg)
__attribute__((alias("ioctl")));
int sys_close(int fd)
__attribute__((alias("close")));
static struct sel_arg_struct as; /* declared as local, it won't work */
int sys_select(int max, void *in, void *out, void *exc, void *tout)
......@@ -89,7 +92,7 @@ int sys_clock_gettime(int clock, void *t)
#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
#define SYS_PACCEPT 18 /* sys_paccept(2) */
static unsigned long args[4];
static unsigned long args[5];
int sys_socket(int domain, int type, int proto)
{
......@@ -136,3 +139,13 @@ int sys_shutdown(int fd, int flags)
args[1] = flags;
return socketcall(SYS_SHUTDOWN, args);
}
int sys_setsockopt(int fd, int level, int optname, const void *optval, int optlen)
{
args[0] = fd;
args[1] = level;
args[2] = optname;
args[3] = (unsigned long)optval;
args[4] = optlen;
return socketcall(SYS_SETSOCKOPT, args);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment