Xenomai  3.0.8
socket.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #pragma GCC system_header
19 #include_next <sys/socket.h>
20 
21 #ifndef _COBALT_SYS_SOCKET_H
22 #define _COBALT_SYS_SOCKET_H
23 
24 #include <cobalt/wrappers.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 COBALT_DECL(int, socket(int protocol_family,
31  int socket_type, int protocol));
32 
33 COBALT_DECL(ssize_t, recvmsg(int fd,
34  struct msghdr *msg, int flags));
35 
36 COBALT_DECL(ssize_t, sendmsg(int fd,
37  const struct msghdr *msg, int flags));
38 
39 COBALT_DECL(ssize_t, recvfrom(int fd, void *buf, size_t len, int flags,
40  struct sockaddr *from, socklen_t *fromlen));
41 
42 COBALT_DECL(ssize_t, sendto(int fd, const void *buf, size_t len, int flags,
43  const struct sockaddr *to, socklen_t tolen));
44 
45 COBALT_DECL(ssize_t, recv(int fd, void *buf,
46  size_t len, int flags));
47 
48 COBALT_DECL(ssize_t, send(int fd, const void *buf,
49  size_t len, int flags));
50 
51 COBALT_DECL(int, getsockopt(int fd, int level, int optname,
52  void *optval, socklen_t *optlen));
53 
54 COBALT_DECL(int, setsockopt(int fd, int level, int optname,
55  const void *optval, socklen_t optlen));
56 
57 COBALT_DECL(int, bind(int fd, const struct sockaddr *my_addr,
58  socklen_t addrlen));
59 
60 COBALT_DECL(int, connect(int fd, const struct sockaddr *serv_addr,
61  socklen_t addrlen));
62 
63 COBALT_DECL(int, listen(int fd, int backlog));
64 
65 COBALT_DECL(int, accept(int fd, struct sockaddr *addr,
66  socklen_t *addrlen));
67 
68 COBALT_DECL(int, getsockname(int fd, struct sockaddr *name,
69  socklen_t *namelen));
70 
71 COBALT_DECL(int, getpeername(int fd, struct sockaddr *name,
72  socklen_t *namelen));
73 
74 COBALT_DECL(int, shutdown(int fd, int how));
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* !_COBALT_SYS_SOCKET_H */