Commit | Line | Data |
---|---|---|
9f0b180a RS |
1 | /* |
2 | Copyright (C) 2013 by Ronnie Sahlberg <ronniesahlberg@gmail.com> | |
3 | ||
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU Lesser General Public License as published by | |
6 | the Free Software Foundation; either version 2.1 of the License, or | |
7 | (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 Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public License | |
15 | along with this program; if not, see <http://www.gnu.org/licenses/>. | |
16 | */ | |
17 | ||
d7c6e9aa RS |
18 | #ifndef AROS_COMPAT_H |
19 | #define AROS_COMPAT_H | |
20 | ||
00748f36 RS |
21 | #include <unistd.h> |
22 | #include <sys/types.h> | |
23 | #include <sys/ioctl.h> | |
d7c6e9aa RS |
24 | #include <netinet/in.h> |
25 | #include <sys/mount.h> | |
e77d093c | 26 | #include <proto/socket.h> |
2cdf4fcb | 27 | #include <proto/exec.h> |
26527603 RS |
28 | #include <netdb.h> |
29 | #include <net/if.h> | |
0556ee05 | 30 | #include <netinet/in.h> |
d7c6e9aa RS |
31 | |
32 | #define statvfs statfs | |
2cdf4fcb RS |
33 | #define ioctl IoctlSocket |
34 | #define close CloseSocket | |
35 | ||
f69bd554 RS |
36 | #define inet_pton aros_inet_pton |
37 | #define freeaddrinfo aros_freeaddrinfo | |
38 | #define getnameinfo aros_getnameinfo | |
39 | #define getaddrinfo aros_getaddrinfo | |
40 | ||
2cdf4fcb RS |
41 | extern struct Library * SocketBase; |
42 | ||
43 | void aros_init_socket(void); | |
d7c6e9aa RS |
44 | |
45 | #define f_flag f_flags | |
46 | #define f_favail f_ffree | |
47 | /* we dont have these at all */ | |
48 | #define f_fsid f_spare[0] | |
49 | #define f_frsize f_spare[0] | |
50 | #define f_namemax f_spare[0] | |
51 | ||
52 | #define POLLIN 0x0001 /* There is data to read */ | |
53 | #define POLLPRI 0x0002 /* There is urgent data to read */ | |
54 | #define POLLOUT 0x0004 /* Writing now will not block */ | |
55 | #define POLLERR 0x0008 /* Error condition */ | |
56 | #define POLLHUP 0x0010 /* Hung up */ | |
57 | #define POLLNVAL 0x0020 /* Invalid request: fd not open */ | |
58 | ||
0556ee05 RS |
59 | struct utimbuf { |
60 | int actime; | |
61 | int modtime; | |
62 | }; | |
63 | ||
d7c6e9aa RS |
64 | struct pollfd { |
65 | int fd; /* file descriptor */ | |
66 | short events; /* requested events */ | |
67 | short revents; /* returned events */ | |
68 | }; | |
69 | ||
70 | #define poll(x, y, z) aros_poll(x, y, z) | |
71 | ||
72 | #endif |