Xenomai 3.3.2
Loading...
Searching...
No Matches
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
27extern "C" {
28#endif
29
30COBALT_DECL(int, socket, (int protocol_family, int socket_type, int protocol));
31
32COBALT_DECL(ssize_t, recvmsg, (int fd, struct msghdr *msg, int flags));
33
34COBALT_DECL_TIME64(int, recvmmsg, __recvmmsg64,
35 (int fd, struct mmsghdr *msgvec, unsigned int vlen,
36 unsigned int flags, struct timespec *timeout));
37
38COBALT_DECL(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags));
39
40COBALT_DECL(int, sendmmsg,
41 (int fd, struct mmsghdr *msgvec, unsigned int vlen,
42 unsigned int flags));
43
44COBALT_DECL(ssize_t, recvfrom,
45 (int fd, void *buf, size_t len, int flags, struct sockaddr *from,
46 socklen_t *fromlen));
47
48COBALT_DECL(ssize_t, sendto,
49 (int fd, const void *buf, size_t len, int flags,
50 const struct sockaddr *to, socklen_t tolen));
51
52COBALT_DECL(ssize_t, recv, (int fd, void *buf, size_t len, int flags));
53
54COBALT_DECL(ssize_t, send, (int fd, const void *buf, size_t len, int flags));
55
56COBALT_DECL_TIME64(int, getsockopt, __getsockopt64,
57 (int fd, int level, int optname, void *optval,
58 socklen_t *optlen));
59
60COBALT_DECL_TIME64(int, setsockopt, __setsockopt64,
61 (int fd, int level, int optname, const void *optval,
62 socklen_t optlen));
63
64COBALT_DECL(int, bind,
65 (int fd, const struct sockaddr *my_addr, socklen_t addrlen));
66
67COBALT_DECL(int, connect,
68 (int fd, const struct sockaddr *serv_addr, socklen_t addrlen));
69
70COBALT_DECL(int, listen, (int fd, int backlog));
71
72COBALT_DECL(int, accept, (int fd, struct sockaddr *addr, socklen_t *addrlen));
73
74COBALT_DECL(int, getsockname,
75 (int fd, struct sockaddr *name, socklen_t *namelen));
76
77COBALT_DECL(int, getpeername,
78 (int fd, struct sockaddr *name, socklen_t *namelen));
79
80COBALT_DECL(int, shutdown, (int fd, int how));
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* !_COBALT_SYS_SOCKET_H */