Xenomai  3.1
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(int, recvmmsg(int fd,
37  struct mmsghdr *msgvec, unsigned int vlen,
38  unsigned int flags, struct timespec *timeout));
39 
40 COBALT_DECL(ssize_t, sendmsg(int fd,
41  const struct msghdr *msg, int flags));
42 
43 COBALT_DECL(int, sendmmsg(int fd,
44  struct mmsghdr *msgvec, unsigned int vlen,
45  unsigned int flags));
46 
47 COBALT_DECL(ssize_t, recvfrom(int fd, void *buf, size_t len, int flags,
48  struct sockaddr *from, socklen_t *fromlen));
49 
50 COBALT_DECL(ssize_t, sendto(int fd, const void *buf, size_t len, int flags,
51  const struct sockaddr *to, socklen_t tolen));
52 
53 COBALT_DECL(ssize_t, recv(int fd, void *buf,
54  size_t len, int flags));
55 
56 COBALT_DECL(ssize_t, send(int fd, const void *buf,
57  size_t len, int flags));
58 
59 COBALT_DECL(int, getsockopt(int fd, int level, int optname,
60  void *optval, socklen_t *optlen));
61 
62 COBALT_DECL(int, setsockopt(int fd, int level, int optname,
63  const void *optval, socklen_t optlen));
64 
65 COBALT_DECL(int, bind(int fd, const struct sockaddr *my_addr,
66  socklen_t addrlen));
67 
68 COBALT_DECL(int, connect(int fd, const struct sockaddr *serv_addr,
69  socklen_t addrlen));
70 
71 COBALT_DECL(int, listen(int fd, int backlog));
72 
73 COBALT_DECL(int, accept(int fd, struct sockaddr *addr,
74  socklen_t *addrlen));
75 
76 COBALT_DECL(int, getsockname(int fd, struct sockaddr *name,
77  socklen_t *namelen));
78 
79 COBALT_DECL(int, getpeername(int fd, struct sockaddr *name,
80  socklen_t *namelen));
81 
82 COBALT_DECL(int, shutdown(int fd, int how));
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* !_COBALT_SYS_SOCKET_H */