opuntiaOS - an operating system targeting x86 and ARMv7
at master 492 B view raw
1#include <sys/socket.h> 2#include <sysdep.h> 3 4int socket(int domain, int type, int protocol) 5{ 6 int res = DO_SYSCALL_3(SYS_SOCKET, domain, type, protocol); 7 RETURN_WITH_ERRNO(res, res, -1); 8} 9 10int bind(int sockfd, const char* name, int len) 11{ 12 int res = DO_SYSCALL_3(SYS_BIND, sockfd, name, len); 13 RETURN_WITH_ERRNO(res, 0, -1); 14} 15 16int connect(int sockfd, const char* name, int len) 17{ 18 int res = DO_SYSCALL_3(SYS_CONNECT, sockfd, name, len); 19 RETURN_WITH_ERRNO(res, 0, -1); 20}