Xenomai API  2.6.5
socket.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <[email protected]>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef _XENO_POSIX_SOCKET_H
20 #define _XENO_POSIX_SOCKET_H
21 
22 #if !(defined(__KERNEL__) || defined(__XENO_SIM__))
23 
24 #pragma GCC system_header
25 
26 #include_next <sys/socket.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 int __real_socket(int protocol_family, int socket_type, int protocol);
33 
34 ssize_t __real_recvmsg(int fd, struct msghdr *msg, int flags);
35 
36 ssize_t __real_sendmsg(int fd, const struct msghdr *msg, int flags);
37 
38 ssize_t __real_recvfrom(int fd, void *buf, size_t len, int flags,
39  struct sockaddr *from, socklen_t *fromlen);
40 
41 ssize_t __real_sendto(int fd, const void *buf, size_t len, int flags,
42  const struct sockaddr *to, socklen_t tolen);
43 
44 ssize_t __real_recv(int fd, void *buf, size_t len, int flags);
45 
46 ssize_t __real_send(int fd, const void *buf, size_t len, int flags);
47 
48 int __real_getsockopt(int fd, int level, int optname, void *optval,
49  socklen_t *optlen);
50 
51 int __real_setsockopt(int fd, int level, int optname, const void *optval,
52  socklen_t optlen);
53 
54 int __real_bind(int fd, const struct sockaddr *my_addr, socklen_t addrlen);
55 
56 int __real_connect(int fd, const struct sockaddr *serv_addr,
57  socklen_t addrlen);
58 
59 int __real_listen(int fd, int backlog);
60 
61 int __real_accept(int fd, struct sockaddr *addr, socklen_t *addrlen);
62 
63 int __real_getsockname(int fd, struct sockaddr *name, socklen_t *namelen);
64 
65 int __real_getpeername(int fd, struct sockaddr *name, socklen_t *namelen);
66 
67 int __real_shutdown(int fd, int how);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* !(__KERNEL__ || __XENO_SIM__) */
74 
75 #endif /* _XENO_POSIX_SOCKET_H */