1 | #ifndef __IPHLWRAP_H__
|
---|
2 | #define __IPHLWRAP_H__
|
---|
3 |
|
---|
4 | #include <sys/socket.h>
|
---|
5 | #include <sys/ioctl.h>
|
---|
6 | #include <netdb.h>
|
---|
7 | #include <netinet/in.h>
|
---|
8 | #include <netinet/tcp.h>
|
---|
9 | #include <nerrno.h>
|
---|
10 |
|
---|
11 | inline int _os2_ioctl (int a, unsigned long b, char *c, int d)
|
---|
12 | {
|
---|
13 | int yyrc;
|
---|
14 | USHORT sel = RestoreOS2FS();
|
---|
15 |
|
---|
16 | yyrc = os2_ioctl(a, b, c, d);
|
---|
17 | SetFS(sel);
|
---|
18 |
|
---|
19 | return yyrc;
|
---|
20 | }
|
---|
21 |
|
---|
22 | #undef os2_ioctl
|
---|
23 | #define ioctl _os2_ioctl
|
---|
24 |
|
---|
25 | inline int _res_init(void)
|
---|
26 | {
|
---|
27 | int yyrc;
|
---|
28 | USHORT sel = RestoreOS2FS();
|
---|
29 |
|
---|
30 | yyrc = res_init();
|
---|
31 | SetFS(sel);
|
---|
32 |
|
---|
33 | return yyrc;
|
---|
34 | }
|
---|
35 | #undef res_init
|
---|
36 | #define res_init _res_init
|
---|
37 |
|
---|
38 | inline int _sock_init()
|
---|
39 | {
|
---|
40 | int yyrc;
|
---|
41 | USHORT sel = RestoreOS2FS();
|
---|
42 |
|
---|
43 | yyrc = sock_init();
|
---|
44 | SetFS(sel);
|
---|
45 |
|
---|
46 | return yyrc;
|
---|
47 | }
|
---|
48 |
|
---|
49 | #undef sock_init
|
---|
50 | #define sock_init _sock_init
|
---|
51 |
|
---|
52 | inline int _sock_errno()
|
---|
53 | {
|
---|
54 | int yyrc;
|
---|
55 | USHORT sel = RestoreOS2FS();
|
---|
56 |
|
---|
57 | yyrc = sock_errno();
|
---|
58 | SetFS(sel);
|
---|
59 |
|
---|
60 | return yyrc;
|
---|
61 | }
|
---|
62 |
|
---|
63 | #undef sock_errno
|
---|
64 | #define sock_errno _sock_errno
|
---|
65 |
|
---|
66 | inline void _psock_errno(char *a)
|
---|
67 | {
|
---|
68 | USHORT sel = RestoreOS2FS();
|
---|
69 |
|
---|
70 | psock_errno(a);
|
---|
71 | SetFS(sel);
|
---|
72 | }
|
---|
73 |
|
---|
74 | #undef psock_errno
|
---|
75 | #define psock_errno _psock_errno
|
---|
76 |
|
---|
77 | inline int _socket(int a, int b, int c)
|
---|
78 | {
|
---|
79 | int yyrc;
|
---|
80 | USHORT sel = RestoreOS2FS();
|
---|
81 |
|
---|
82 | yyrc = socket(a, b, c);
|
---|
83 | SetFS(sel);
|
---|
84 |
|
---|
85 | return yyrc;
|
---|
86 | }
|
---|
87 |
|
---|
88 | #undef socket
|
---|
89 | #define socket _socket
|
---|
90 |
|
---|
91 | inline int _soclose(int a)
|
---|
92 | {
|
---|
93 | int yyrc;
|
---|
94 | USHORT sel = RestoreOS2FS();
|
---|
95 |
|
---|
96 | yyrc = soclose(a);
|
---|
97 | SetFS(sel);
|
---|
98 |
|
---|
99 | return yyrc;
|
---|
100 | }
|
---|
101 |
|
---|
102 | #undef soclose
|
---|
103 | #define soclose _soclose
|
---|
104 |
|
---|
105 | inline int _so_cancel(int a)
|
---|
106 | {
|
---|
107 | int yyrc;
|
---|
108 | USHORT sel = RestoreOS2FS();
|
---|
109 |
|
---|
110 | yyrc = so_cancel(a);
|
---|
111 | SetFS(sel);
|
---|
112 |
|
---|
113 | return yyrc;
|
---|
114 | }
|
---|
115 |
|
---|
116 | #undef so_cancel
|
---|
117 | #define so_cancel _so_cancel
|
---|
118 |
|
---|
119 | inline int _gethostname(char *a, int b)
|
---|
120 | {
|
---|
121 | int yyrc;
|
---|
122 | USHORT sel = RestoreOS2FS();
|
---|
123 |
|
---|
124 | yyrc = gethostname(a, b);
|
---|
125 | SetFS(sel);
|
---|
126 |
|
---|
127 | return yyrc;
|
---|
128 | }
|
---|
129 |
|
---|
130 | #undef gethostname
|
---|
131 | #define gethostname _gethostname
|
---|
132 |
|
---|
133 | inline struct hostent *_gethostbyname(char *a)
|
---|
134 | {
|
---|
135 | struct hostent * yyrc;
|
---|
136 | USHORT sel = RestoreOS2FS();
|
---|
137 |
|
---|
138 | yyrc = gethostbyname(a);
|
---|
139 | SetFS(sel);
|
---|
140 |
|
---|
141 | return yyrc;
|
---|
142 | }
|
---|
143 |
|
---|
144 | #undef gethostbyname
|
---|
145 | #define gethostbyname _gethostbyname
|
---|
146 |
|
---|
147 | inline struct hostent *_gethostbyaddr(char *a, int b, int c)
|
---|
148 | {
|
---|
149 | struct hostent * yyrc;
|
---|
150 | USHORT sel = RestoreOS2FS();
|
---|
151 |
|
---|
152 | yyrc = gethostbyaddr(a, b, c);
|
---|
153 | SetFS(sel);
|
---|
154 |
|
---|
155 | return yyrc;
|
---|
156 | }
|
---|
157 |
|
---|
158 | #undef gethostbyaddr
|
---|
159 | #define gethostbyaddr _gethostbyaddr
|
---|
160 |
|
---|
161 | #endif
|
---|
162 |
|
---|
163 |
|
---|