Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / libc / socket / recv.c
blob68e469938dc35cd6613df555164fdbbd856ee472
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 recv (int fd, char *msg, size_t size, int flags)
29 asm volatile (
30 "movl $16, %%eax;"
31 "movl %0, %%ecx;"
32 "movl %1, %%ebx;"
33 "movl %2, %%edx;"
34 "int $0x80;" :: "g" (fd), "b" (msg), "g" (size) : "%eax", "%ecx", "%edx", "memory");
36 errno_update ();
38 /* get return value */
39 return (int) *SYSV_RECV;