Imported Upstream version 1.9.4
[deb_libnfs.git] / aros / aros_compat.h
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
18 #ifndef AROS_COMPAT_H
19 #define AROS_COMPAT_H
20
21 #include <unistd.h>
22 #include <sys/types.h>
23 #include <sys/ioctl.h>
24 #include <netinet/in.h>
25 #include <sys/mount.h>
26 #include <proto/socket.h>
27 #include <proto/exec.h>
28 #include <netdb.h>
29 #include <net/if.h>
30 #include <netinet/in.h>
31
32 #define statvfs statfs
33 #define ioctl IoctlSocket
34 #define close CloseSocket
35
36 #define inet_pton aros_inet_pton
37 #define freeaddrinfo aros_freeaddrinfo
38 #define getnameinfo aros_getnameinfo
39 #define getaddrinfo aros_getaddrinfo
40
41 extern struct Library * SocketBase;
42
43 void aros_init_socket(void);
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
59 struct utimbuf {
60 int actime;
61 int modtime;
62 };
63
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