source: trunk/src/iphlpapi/iphlwrap.h

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 2.3 KB
RevLine 
[7973]1#ifndef __IPHLWRAP_H__
2#define __IPHLWRAP_H__
3
[21916]4#include <sys/socket.h>
5#include <sys/ioctl.h>
[7973]6#include <netdb.h>
[21916]7#include <netinet/in.h>
8#include <netinet/tcp.h>
[7973]9#include <nerrno.h>
10
11inline 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
[21916]23#define ioctl _os2_ioctl
[7973]24
25inline int _res_init(void)
26{
27 int yyrc;
28 USHORT sel = RestoreOS2FS();
29
30 yyrc = res_init();
31 SetFS(sel);
32
33 return yyrc;
[21916]34}
[7973]35#undef res_init
36#define res_init _res_init
37
38inline int _sock_init()
39{
40 int yyrc;
41 USHORT sel = RestoreOS2FS();
42
43 yyrc = sock_init();
44 SetFS(sel);
45
46 return yyrc;
[21916]47}
[7973]48
49#undef sock_init
50#define sock_init _sock_init
51
52inline int _sock_errno()
53{
54 int yyrc;
55 USHORT sel = RestoreOS2FS();
56
57 yyrc = sock_errno();
58 SetFS(sel);
59
60 return yyrc;
[21916]61}
[7973]62
63#undef sock_errno
64#define sock_errno _sock_errno
65
66inline void _psock_errno(char *a)
67{
68 USHORT sel = RestoreOS2FS();
69
70 psock_errno(a);
71 SetFS(sel);
[21916]72}
[7973]73
74#undef psock_errno
75#define psock_errno _psock_errno
76
77inline 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;
[21916]86}
[7973]87
88#undef socket
89#define socket _socket
90
91inline int _soclose(int a)
92{
93 int yyrc;
94 USHORT sel = RestoreOS2FS();
95
96 yyrc = soclose(a);
97 SetFS(sel);
98
99 return yyrc;
[21916]100}
[7973]101
102#undef soclose
103#define soclose _soclose
104
105inline 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;
[21916]114}
[7973]115
116#undef so_cancel
117#define so_cancel _so_cancel
118
119inline 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;
[21916]128}
[7973]129
130#undef gethostname
131#define gethostname _gethostname
132
133inline 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;
[21916]142}
[7973]143
144#undef gethostbyname
145#define gethostbyname _gethostbyname
146
147inline 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;
[21916]156}
[7973]157
158#undef gethostbyaddr
159#define gethostbyaddr _gethostbyaddr
160
[21916]161#endif
[7973]162
163
Note: See TracBrowser for help on using the repository browser.