annotate src/os/solaris/vm/hpi_solaris.hpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 222
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef OS_SOLARIS_VM_HPI_SOLARIS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define OS_SOLARIS_VM_HPI_SOLARIS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
0
a61af66fc99e Initial load
duke
parents:
diff changeset
28 //
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // Parts of the HPI interface for which the HotSparc does not use the
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // HPI (because the interruptible IO mechanims used are different).
a61af66fc99e Initial load
duke
parents:
diff changeset
31 //
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 #include <sys/socket.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
34 #include <sys/poll.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
35 #include <sys/filio.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
36 #include <unistd.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
37 #include <netdb.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
38 #include <setjmp.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // HPI_FileInterface
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Many system calls can be interrupted by signals and must be restarted.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // Restart support was added without disturbing the extent of thread
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // interruption support.
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 inline int hpi::close(int fd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 RESTARTABLE_RETURN_INT(::close(fd));
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 INTERRUPTIBLE_RETURN_INT(::read(fd, buf, nBytes), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
52 }
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 inline size_t hpi::write(int fd, const void *buf, unsigned int nBytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
55 INTERRUPTIBLE_RETURN_INT(::write(fd, buf, nBytes), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 }
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // HPI_SocketInterface
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 inline int hpi::socket_close(int fd) {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 RESTARTABLE_RETURN_INT(::close(fd));
a61af66fc99e Initial load
duke
parents:
diff changeset
63 }
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 inline int hpi::socket(int domain, int type, int protocol) {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 return ::socket(domain, type, protocol);
a61af66fc99e Initial load
duke
parents:
diff changeset
67 }
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 inline int hpi::recv(int fd, char *buf, int nBytes, int flags) {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 INTERRUPTIBLE_RETURN_INT(::recv(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 inline int hpi::send(int fd, char *buf, int nBytes, int flags) {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
222
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
77 inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) {
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
78 RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
79 }
2a1a77d3458f 6718676: putback for 6604014 is incomplete
never
parents: 0
diff changeset
80
0
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // As both poll and select can be interrupted by signals, we have to be
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // prepared to restart the system call after updating the timeout, unless
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // a poll() is done with timeout == -1, in which case we repeat with this
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // "wait forever" value.
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 inline int hpi::timeout(int fd, long timeout) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 int res;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 struct timeval t;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 julong prevtime, newtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 static const char* aNull = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 struct pollfd pfd;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 pfd.fd = fd;
a61af66fc99e Initial load
duke
parents:
diff changeset
94 pfd.events = POLLIN;
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 gettimeofday(&t, &aNull);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 for(;;) {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 INTERRUPTIBLE_NORESTART(::poll(&pfd, 1, timeout), res, os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 if(res == OS_ERR && errno == EINTR) {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 if(timeout != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
103 gettimeofday(&t, &aNull);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 timeout -= newtime - prevtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 if(timeout <= 0)
a61af66fc99e Initial load
duke
parents:
diff changeset
107 return OS_OK;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 prevtime = newtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110 } else
a61af66fc99e Initial load
duke
parents:
diff changeset
111 return res;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 inline int hpi::listen(int fd, int count) {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 if (fd < 0)
a61af66fc99e Initial load
duke
parents:
diff changeset
117 return OS_ERR;
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return ::listen(fd, count);
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 inline int
a61af66fc99e Initial load
duke
parents:
diff changeset
123 hpi::connect(int fd, struct sockaddr *him, int len) {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 do {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 int _result;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 INTERRUPTIBLE_NORESTART(::connect(fd, him, len), _result,
a61af66fc99e Initial load
duke
parents:
diff changeset
127 os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // Depending on when thread interruption is reset, _result could be
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // one of two values when errno == EINTR
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 if (((_result == OS_INTRPT) || (_result == OS_ERR)) && (errno == EINTR)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 /* restarting a connect() changes its errno semantics */
a61af66fc99e Initial load
duke
parents:
diff changeset
134 INTERRUPTIBLE(::connect(fd, him, len), _result,
a61af66fc99e Initial load
duke
parents:
diff changeset
135 os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
136 /* undo these changes */
a61af66fc99e Initial load
duke
parents:
diff changeset
137 if (_result == OS_ERR) {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 if (errno == EALREADY) errno = EINPROGRESS; /* fall through */
a61af66fc99e Initial load
duke
parents:
diff changeset
139 else if (errno == EISCONN) { errno = 0; return OS_OK; }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
a61af66fc99e Initial load
duke
parents:
diff changeset
142 return _result;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 } while(false);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 inline int hpi::accept(int fd, struct sockaddr *him, int *len) {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 if (fd < 0)
a61af66fc99e Initial load
duke
parents:
diff changeset
148 return OS_ERR;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 INTERRUPTIBLE_RETURN_INT((int)::accept(fd, him, (socklen_t*) len), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 inline int hpi::recvfrom(int fd, char *buf, int nBytes, int flags,
a61af66fc99e Initial load
duke
parents:
diff changeset
153 sockaddr *from, int *fromlen) {
a61af66fc99e Initial load
duke
parents:
diff changeset
154 //%%note jvm_r11
a61af66fc99e Initial load
duke
parents:
diff changeset
155 INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes, (unsigned int) flags, from, (socklen_t *)fromlen), os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 inline int hpi::sendto(int fd, char *buf, int len, int flags,
a61af66fc99e Initial load
duke
parents:
diff changeset
159 struct sockaddr *to, int tolen) {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 //%%note jvm_r11
a61af66fc99e Initial load
duke
parents:
diff changeset
161 INTERRUPTIBLE_RETURN_INT((int)::sendto(fd, buf, len, (unsigned int) flags, to, tolen),os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
162 }
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 inline int hpi::socket_available(int fd, jint *pbytes) {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 if (fd < 0)
a61af66fc99e Initial load
duke
parents:
diff changeset
166 return OS_OK;
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 int ret;
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 //%% note ioctl can return 0 when successful, JVM_SocketAvailable
a61af66fc99e Initial load
duke
parents:
diff changeset
173 // is expected to return 0 on failure and 1 on success to the jdk.
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 return (ret == OS_ERR) ? 0 : 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
180 HPIDECL(socket_shutdown, "socket_shutdown", _socket, SocketShutdown,
a61af66fc99e Initial load
duke
parents:
diff changeset
181 int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
182 (int fd, int howto),
a61af66fc99e Initial load
duke
parents:
diff changeset
183 ("fd = %d, howto = %d", fd, howto),
a61af66fc99e Initial load
duke
parents:
diff changeset
184 (fd, howto));
a61af66fc99e Initial load
duke
parents:
diff changeset
185 */
a61af66fc99e Initial load
duke
parents:
diff changeset
186 inline int hpi::socket_shutdown(int fd, int howto){
a61af66fc99e Initial load
duke
parents:
diff changeset
187 return ::shutdown(fd, howto);
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
191 HPIDECL(bind, "bind", _socket, Bind,
a61af66fc99e Initial load
duke
parents:
diff changeset
192 int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
193 (int fd, struct sockaddr *him, int len),
a61af66fc99e Initial load
duke
parents:
diff changeset
194 ("fd = %d, him = %p, len = %d",
a61af66fc99e Initial load
duke
parents:
diff changeset
195 fd, him, len),
a61af66fc99e Initial load
duke
parents:
diff changeset
196 (fd, him, len));
a61af66fc99e Initial load
duke
parents:
diff changeset
197 */
a61af66fc99e Initial load
duke
parents:
diff changeset
198 inline int hpi::bind(int fd, struct sockaddr *him, int len){
a61af66fc99e Initial load
duke
parents:
diff changeset
199 INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),os::Solaris::clear_interrupted);
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
203 HPIDECL(get_sock_name, "get_sock_name", _socket, GetSocketName,
a61af66fc99e Initial load
duke
parents:
diff changeset
204 int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
205 (int fd, struct sockaddr *him, int *len),
a61af66fc99e Initial load
duke
parents:
diff changeset
206 ("fd = %d, him = %p, len = %p",
a61af66fc99e Initial load
duke
parents:
diff changeset
207 fd, him, len),
a61af66fc99e Initial load
duke
parents:
diff changeset
208 (fd, him, len));
a61af66fc99e Initial load
duke
parents:
diff changeset
209 */
a61af66fc99e Initial load
duke
parents:
diff changeset
210 inline int hpi::get_sock_name(int fd, struct sockaddr *him, int *len){
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return ::getsockname(fd, him, (socklen_t*) len);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
215 HPIDECL(get_host_name, "get_host_name", _socket, GetHostName, int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
216 (char *hostname, int namelen),
a61af66fc99e Initial load
duke
parents:
diff changeset
217 ("hostname = %p, namelen = %d",
a61af66fc99e Initial load
duke
parents:
diff changeset
218 hostname, namelen),
a61af66fc99e Initial load
duke
parents:
diff changeset
219 (hostname, namelen));
a61af66fc99e Initial load
duke
parents:
diff changeset
220 */
a61af66fc99e Initial load
duke
parents:
diff changeset
221 inline int hpi::get_host_name(char* name, int namelen){
a61af66fc99e Initial load
duke
parents:
diff changeset
222 return ::gethostname(name, namelen);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 }
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
226 HPIDECL(get_sock_opt, "get_sock_opt", _socket, SocketGetOption, int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
227 (int fd, int level, int optname, char *optval, int* optlen),
a61af66fc99e Initial load
duke
parents:
diff changeset
228 ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %p",
a61af66fc99e Initial load
duke
parents:
diff changeset
229 fd, level, optname, optval, optlen),
a61af66fc99e Initial load
duke
parents:
diff changeset
230 (fd, level, optname, optval, optlen));
a61af66fc99e Initial load
duke
parents:
diff changeset
231 */
a61af66fc99e Initial load
duke
parents:
diff changeset
232 inline int hpi::get_sock_opt(int fd, int level, int optname,
a61af66fc99e Initial load
duke
parents:
diff changeset
233 char *optval, int* optlen){
a61af66fc99e Initial load
duke
parents:
diff changeset
234 return ::getsockopt(fd, level, optname, optval, (socklen_t*) optlen);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 }
a61af66fc99e Initial load
duke
parents:
diff changeset
236
a61af66fc99e Initial load
duke
parents:
diff changeset
237 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
238 HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
a61af66fc99e Initial load
duke
parents:
diff changeset
239 (int fd, int level, int optname, const char *optval, int optlen),
a61af66fc99e Initial load
duke
parents:
diff changeset
240 ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
a61af66fc99e Initial load
duke
parents:
diff changeset
241 fd, level, optname, optval, optlen),
a61af66fc99e Initial load
duke
parents:
diff changeset
242 (fd, level, optname, optval, optlen));
a61af66fc99e Initial load
duke
parents:
diff changeset
243 */
a61af66fc99e Initial load
duke
parents:
diff changeset
244 inline int hpi::set_sock_opt(int fd, int level, int optname,
a61af66fc99e Initial load
duke
parents:
diff changeset
245 const char *optval, int optlen){
a61af66fc99e Initial load
duke
parents:
diff changeset
246 return ::setsockopt(fd, level, optname, optval, optlen);
a61af66fc99e Initial load
duke
parents:
diff changeset
247 }
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 //Reconciliation History
a61af66fc99e Initial load
duke
parents:
diff changeset
250 // 1.3 98/10/21 18:17:14 hpi_win32.hpp
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // 1.6 99/06/28 11:01:36 hpi_win32.hpp
a61af66fc99e Initial load
duke
parents:
diff changeset
252 //End
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
253
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
254 #endif // OS_SOLARIS_VM_HPI_SOLARIS_HPP