Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / libc / socket / accept.c
blob14e853c2df0dfff2d7685af363c43416445c2c7a
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * Copyright (C) 2010 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include <string.h>
24 #include <sys/socket.h>
25 #include <_libc.h>
27 int accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
29 asm volatile (
30 "movl $32, %%eax;"
31 "movl %0, %%ecx;"
32 "movl %1, %%ebx;"
33 "movl %2, %%edx;"
34 "int $0x80;" :: "g" (fd), "b" (addr), "g" (addrlen) : "%eax", "%ecx", "%edx", "memory");
36 errno_update ();
38 /* get return value */
39 return (int) *SYSV_ACCEPT;