e_os.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /* e_os.h */
  2. /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  3. * All rights reserved.
  4. *
  5. * This package is an SSL implementation written
  6. * by Eric Young (eay@cryptsoft.com).
  7. * The implementation was written so as to conform with Netscapes SSL.
  8. *
  9. * This library is free for commercial and non-commercial use as long as
  10. * the following conditions are aheared to. The following conditions
  11. * apply to all code found in this distribution, be it the RC4, RSA,
  12. * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  13. * included with this distribution is covered by the same copyright terms
  14. * except that the holder is Tim Hudson (tjh@cryptsoft.com).
  15. *
  16. * Copyright remains Eric Young's, and as such any Copyright notices in
  17. * the code are not to be removed.
  18. * If this package is used in a product, Eric Young should be given attribution
  19. * as the author of the parts of the library used.
  20. * This can be in the form of a textual message at program startup or
  21. * in documentation (online or textual) provided with the package.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. * 1. Redistributions of source code must retain the copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in the
  30. * documentation and/or other materials provided with the distribution.
  31. * 3. All advertising materials mentioning features or use of this software
  32. * must display the following acknowledgement:
  33. * "This product includes cryptographic software written by
  34. * Eric Young (eay@cryptsoft.com)"
  35. * The word 'cryptographic' can be left out if the rouines from the library
  36. * being used are not cryptographic related :-).
  37. * 4. If you include any Windows specific code (or a derivative thereof) from
  38. * the apps directory (application code) you must include an acknowledgement:
  39. * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
  40. *
  41. * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  42. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  43. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  44. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  45. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  46. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  47. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  49. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  50. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  51. * SUCH DAMAGE.
  52. *
  53. * The licence and distribution terms for any publically available version or
  54. * derivative of this code cannot be changed. i.e. this code cannot simply be
  55. * copied and put under another distribution licence
  56. * [including the GNU Public Licence.]
  57. */
  58. #ifndef HEADER_E_OS_H
  59. #define HEADER_E_OS_H
  60. #include <openssl/opensslconf.h>
  61. #include <openssl/e_os2.h>
  62. /* <openssl/e_os2.h> contains what we can justify to make visible
  63. * to the outside; this file e_os.h is not part of the exported
  64. * interface. */
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68. /* Used to checking reference counts, most while doing perl5 stuff :-) */
  69. #ifdef REF_PRINT
  70. #undef REF_PRINT
  71. #define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a)
  72. #endif
  73. #ifndef DEVRANDOM
  74. /* set this to a comma-separated list of 'random' device files to try out.
  75. * My default, we will try to read at least one of these files */
  76. #define DEVRANDOM "/dev/urandom","/dev/random","/dev/srandom"
  77. #endif
  78. #ifndef DEVRANDOM_EGD
  79. /* set this to a comma-seperated list of 'egd' sockets to try out. These
  80. * sockets will be tried in the order listed in case accessing the device files
  81. * listed in DEVRANDOM did not return enough entropy. */
  82. #define DEVRANDOM_EGD "/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"
  83. #endif
  84. #if defined(OPENSSL_SYS_VXWORKS)
  85. # define NO_SYS_PARAM_H
  86. # define NO_CHMOD
  87. # define NO_SYSLOG
  88. #endif
  89. #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC)
  90. # if macintosh==1
  91. # ifndef MAC_OS_GUSI_SOURCE
  92. # define MAC_OS_pre_X
  93. # define NO_SYS_TYPES_H
  94. typedef long ssize_t;
  95. # endif
  96. # define NO_SYS_PARAM_H
  97. # define NO_CHMOD
  98. # define NO_SYSLOG
  99. # undef DEVRANDOM
  100. # define GETPID_IS_MEANINGLESS
  101. # endif
  102. #endif
  103. /********************************************************************
  104. The Microsoft section
  105. ********************************************************************/
  106. /* The following is used becaue of the small stack in some
  107. * Microsoft operating systems */
  108. #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYSNAME_WIN32)
  109. # define MS_STATIC static
  110. #else
  111. # define MS_STATIC
  112. #endif
  113. #if defined(OPENSSL_SYS_WIN32) && !defined(WIN32)
  114. # define WIN32
  115. #endif
  116. #if defined(OPENSSL_SYS_WIN16) && !defined(WIN16)
  117. # define WIN16
  118. #endif
  119. #if defined(OPENSSL_SYS_WINDOWS) && !defined(WINDOWS)
  120. # define WINDOWS
  121. #endif
  122. #if defined(OPENSSL_SYS_MSDOS) && !defined(MSDOS)
  123. # define MSDOS
  124. #endif
  125. #if defined(MSDOS) && !defined(GETPID_IS_MEANINGLESS)
  126. # define GETPID_IS_MEANINGLESS
  127. #endif
  128. #ifdef WIN32
  129. #define get_last_sys_error() GetLastError()
  130. #define clear_sys_error() SetLastError(0)
  131. #if !defined(WINNT)
  132. #define WIN_CONSOLE_BUG
  133. #endif
  134. #else
  135. #define get_last_sys_error() errno
  136. #define clear_sys_error() errno=0
  137. #endif
  138. #if defined(WINDOWS)
  139. #define get_last_socket_error() WSAGetLastError()
  140. #define clear_socket_error() WSASetLastError(0)
  141. #define readsocket(s,b,n) recv((s),(b),(n),0)
  142. #define writesocket(s,b,n) send((s),(b),(n),0)
  143. #define EADDRINUSE WSAEADDRINUSE
  144. #elif defined(__DJGPP__)
  145. #define WATT32
  146. #define get_last_socket_error() errno
  147. #define clear_socket_error() errno=0
  148. #define closesocket(s) close_s(s)
  149. #define readsocket(s,b,n) read_s(s,b,n)
  150. #define writesocket(s,b,n) send(s,b,n,0)
  151. #elif defined(MAC_OS_pre_X)
  152. #define get_last_socket_error() errno
  153. #define clear_socket_error() errno=0
  154. #define closesocket(s) MacSocket_close(s)
  155. #define readsocket(s,b,n) MacSocket_recv((s),(b),(n),true)
  156. #define writesocket(s,b,n) MacSocket_send((s),(b),(n))
  157. #elif defined(OPENSSL_SYS_VMS)
  158. #define get_last_socket_error() errno
  159. #define clear_socket_error() errno=0
  160. #define ioctlsocket(a,b,c) ioctl(a,b,c)
  161. #define closesocket(s) close(s)
  162. #define readsocket(s,b,n) recv((s),(b),(n),0)
  163. #define writesocket(s,b,n) send((s),(b),(n),0)
  164. #elif defined(OPENSSL_SYS_VXWORKS)
  165. #define get_last_socket_error() errno
  166. #define clear_socket_error() errno=0
  167. #define ioctlsocket(a,b,c) ioctl((a),(b),(int)(c))
  168. #define closesocket(s) close(s)
  169. #define readsocket(s,b,n) read((s),(b),(n))
  170. #define writesocket(s,b,n) write((s),(char *)(b),(n))
  171. #else
  172. #define get_last_socket_error() errno
  173. #define clear_socket_error() errno=0
  174. #define ioctlsocket(a,b,c) ioctl(a,b,c)
  175. #define closesocket(s) close(s)
  176. #define readsocket(s,b,n) read((s),(b),(n))
  177. #define writesocket(s,b,n) write((s),(b),(n))
  178. #endif
  179. #ifdef WIN16
  180. # define OPENSSL_NO_FP_API
  181. # define MS_CALLBACK _far _loadds
  182. # define MS_FAR _far
  183. #else
  184. # define MS_CALLBACK
  185. # define MS_FAR
  186. #endif
  187. #ifdef OPENSSL_NO_STDIO
  188. # define OPENSSL_NO_FP_API
  189. #endif
  190. #if (defined(WINDOWS) || defined(MSDOS))
  191. # ifdef __DJGPP__
  192. # include <unistd.h>
  193. # include <sys/stat.h>
  194. # include <sys/socket.h>
  195. # include <tcp.h>
  196. # include <netdb.h>
  197. # define _setmode setmode
  198. # define _O_TEXT O_TEXT
  199. # define _O_BINARY O_BINARY
  200. # undef DEVRANDOM
  201. # define DEVRANDOM "/dev/urandom\x24"
  202. # endif /* __DJGPP__ */
  203. # ifndef S_IFDIR
  204. # define S_IFDIR _S_IFDIR
  205. # endif
  206. # ifndef S_IFMT
  207. # define S_IFMT _S_IFMT
  208. # endif
  209. # if !defined(WINNT) && !defined(__DJGPP__)
  210. # define NO_SYSLOG
  211. # endif
  212. # define NO_DIRENT
  213. # ifdef WINDOWS
  214. # include <windows.h>
  215. # include <stddef.h>
  216. # include <errno.h>
  217. # include <string.h>
  218. # include <malloc.h>
  219. # endif
  220. # include <io.h>
  221. # include <fcntl.h>
  222. # ifdef OPENSSL_SYS_WINCE
  223. # include <winsock_extras.h>
  224. # endif
  225. # define ssize_t long
  226. # if defined (__BORLANDC__)
  227. # define _setmode setmode
  228. # define _O_TEXT O_TEXT
  229. # define _O_BINARY O_BINARY
  230. # define _int64 __int64
  231. # define _kbhit kbhit
  232. # endif
  233. # if defined(WIN16) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
  234. # define EXIT(n) _wsetexit(_WINEXITNOPERSIST)
  235. # define OPENSSL_EXIT(n) do { if (n == 0) EXIT(n); return(n); } while(0)
  236. # else
  237. # define EXIT(n) exit(n)
  238. # endif
  239. # define LIST_SEPARATOR_CHAR ';'
  240. # ifndef X_OK
  241. # define X_OK 0
  242. # endif
  243. # ifndef W_OK
  244. # define W_OK 2
  245. # endif
  246. # ifndef R_OK
  247. # define R_OK 4
  248. # endif
  249. # define OPENSSL_CONF "openssl.cnf"
  250. # define SSLEAY_CONF OPENSSL_CONF
  251. # define NUL_DEV "nul"
  252. # define RFILE ".rnd"
  253. # ifdef OPENSSL_SYS_WINCE
  254. # define DEFAULT_HOME ""
  255. # else
  256. # define DEFAULT_HOME "C:"
  257. # endif
  258. #else /* The non-microsoft world world */
  259. # ifdef OPENSSL_SYS_VMS
  260. # define VMS 1
  261. /* some programs don't include stdlib, so exit() and others give implicit
  262. function warnings */
  263. # include <stdlib.h>
  264. # if defined(__DECC)
  265. # include <unistd.h>
  266. # else
  267. # include <unixlib.h>
  268. # endif
  269. # define OPENSSL_CONF "openssl.cnf"
  270. # define SSLEAY_CONF OPENSSL_CONF
  271. # define RFILE ".rnd"
  272. # define LIST_SEPARATOR_CHAR ','
  273. # define NUL_DEV "NLA0:"
  274. /* We don't have any well-defined random devices on VMS, yet... */
  275. # undef DEVRANDOM
  276. /* We need to do this since VMS has the following coding on status codes:
  277. Bits 0-2: status type: 0 = warning, 1 = success, 2 = error, 3 = info ...
  278. The important thing to know is that odd numbers are considered
  279. good, while even ones are considered errors.
  280. Bits 3-15: actual status number
  281. Bits 16-27: facility number. 0 is considered "unknown"
  282. Bits 28-31: control bits. If bit 28 is set, the shell won't try to
  283. output the message (which, for random codes, just looks ugly)
  284. So, what we do here is to change 0 to 1 to get the default success status,
  285. and everything else is shifted up to fit into the status number field, and
  286. the status is tagged as an error, which I believe is what is wanted here.
  287. -- Richard Levitte
  288. */
  289. # define EXIT(n) do { int __VMS_EXIT = n; \
  290. if (__VMS_EXIT == 0) \
  291. __VMS_EXIT = 1; \
  292. else \
  293. __VMS_EXIT = (n << 3) | 2; \
  294. __VMS_EXIT |= 0x10000000; \
  295. exit(__VMS_EXIT); } while(0)
  296. # define NO_SYS_PARAM_H
  297. # else
  298. /* !defined VMS */
  299. # ifdef OPENSSL_SYS_MPE
  300. # define NO_SYS_PARAM_H
  301. # endif
  302. # ifdef OPENSSL_UNISTD
  303. # include OPENSSL_UNISTD
  304. # else
  305. # include <unistd.h>
  306. # endif
  307. # ifndef NO_SYS_TYPES_H
  308. # include <sys/types.h>
  309. # endif
  310. # if defined(NeXT) || defined(OPENSSL_SYS_NEWS4)
  311. # define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP
  312. * (unless when compiling with -D_POSIX_SOURCE,
  313. * which doesn't work for us) */
  314. # endif
  315. # if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)
  316. # define ssize_t int /* ditto */
  317. # endif
  318. # ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */
  319. # define setvbuf(a, b, c, d) setbuffer((a), (b), (d))
  320. typedef unsigned long clock_t;
  321. # endif
  322. # define OPENSSL_CONF "openssl.cnf"
  323. # define SSLEAY_CONF OPENSSL_CONF
  324. # define RFILE ".rnd"
  325. # define LIST_SEPARATOR_CHAR ':'
  326. # define NUL_DEV "/dev/null"
  327. # define EXIT(n) exit(n)
  328. # endif
  329. # define SSLeay_getpid() getpid()
  330. #endif
  331. /*************/
  332. #ifdef USE_SOCKETS
  333. # if defined(WINDOWS) || defined(MSDOS)
  334. /* windows world */
  335. # ifdef OPENSSL_NO_SOCK
  336. # define SSLeay_Write(a,b,c) (-1)
  337. # define SSLeay_Read(a,b,c) (-1)
  338. # define SHUTDOWN(fd) close(fd)
  339. # define SHUTDOWN2(fd) close(fd)
  340. # elif !defined(__DJGPP__)
  341. # include <winsock.h>
  342. extern HINSTANCE _hInstance;
  343. # define SSLeay_Write(a,b,c) send((a),(b),(c),0)
  344. # define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
  345. # define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
  346. # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
  347. # else
  348. # define SSLeay_Write(a,b,c) write_s(a,b,c,0)
  349. # define SSLeay_Read(a,b,c) read_s(a,b,c)
  350. # define SHUTDOWN(fd) close_s(fd)
  351. # define SHUTDOWN2(fd) close_s(fd)
  352. # endif
  353. # elif defined(MAC_OS_pre_X)
  354. # include "MacSocket.h"
  355. # define SSLeay_Write(a,b,c) MacSocket_send((a),(b),(c))
  356. # define SSLeay_Read(a,b,c) MacSocket_recv((a),(b),(c),true)
  357. # define SHUTDOWN(fd) MacSocket_close(fd)
  358. # define SHUTDOWN2(fd) MacSocket_close(fd)
  359. # else
  360. # ifndef NO_SYS_PARAM_H
  361. # include <sys/param.h>
  362. # endif
  363. # ifdef OPENSSL_SYS_VXWORKS
  364. # include <time.h>
  365. # elif !defined(OPENSSL_SYS_MPE)
  366. # include <sys/time.h> /* Needed under linux for FD_XXX */
  367. # endif
  368. # include <netdb.h>
  369. # if defined(OPENSSL_SYS_VMS_NODECC)
  370. # include <socket.h>
  371. # include <in.h>
  372. # include <inet.h>
  373. # else
  374. # include <sys/socket.h>
  375. # ifdef FILIO_H
  376. # include <sys/filio.h> /* Added for FIONBIO under unixware */
  377. # endif
  378. # include <netinet/in.h>
  379. # include <arpa/inet.h>
  380. # endif
  381. # if defined(NeXT) || defined(_NEXT_SOURCE)
  382. # include <sys/fcntl.h>
  383. # include <sys/types.h>
  384. # endif
  385. # ifdef OPENSSL_SYS_AIX
  386. # include <sys/select.h>
  387. # endif
  388. # ifdef __QNX__
  389. # include <sys/select.h>
  390. # endif
  391. # if defined(sun)
  392. # include <sys/filio.h>
  393. # else
  394. # ifndef VMS
  395. # include <sys/ioctl.h>
  396. # else
  397. /* ioctl is only in VMS > 7.0 and when socketshr is not used */
  398. # if !defined(TCPIP_TYPE_SOCKETSHR) && defined(__VMS_VER) && (__VMS_VER > 70000000)
  399. # include <sys/ioctl.h>
  400. # endif
  401. # endif
  402. # endif
  403. # ifdef VMS
  404. # include <unixio.h>
  405. # if defined(TCPIP_TYPE_SOCKETSHR)
  406. # include <socketshr.h>
  407. # endif
  408. # endif
  409. # define SSLeay_Read(a,b,c) read((a),(b),(c))
  410. # define SSLeay_Write(a,b,c) write((a),(b),(c))
  411. # define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); }
  412. # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); }
  413. # ifndef INVALID_SOCKET
  414. # define INVALID_SOCKET (-1)
  415. # endif /* INVALID_SOCKET */
  416. # endif
  417. #endif
  418. #if defined(__ultrix)
  419. # ifndef ssize_t
  420. # define ssize_t int
  421. # endif
  422. #endif
  423. #if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
  424. /* include headers first, so our defines don't break it */
  425. #include <stdlib.h>
  426. #include <string.h>
  427. /* bcopy can handle overlapping moves according to SunOS 4.1.4 manpage */
  428. # define memmove(s1,s2,n) bcopy((s2),(s1),(n))
  429. # define strtoul(s,e,b) ((unsigned long int)strtol((s),(e),(b)))
  430. extern char *sys_errlist[]; extern int sys_nerr;
  431. # define strerror(errnum) \
  432. (((errnum)<0 || (errnum)>=sys_nerr) ? NULL : sys_errlist[errnum])
  433. #endif
  434. #ifndef OPENSSL_EXIT
  435. # if defined(MONOLITH) && !defined(OPENSSL_C)
  436. # define OPENSSL_EXIT(n) return(n)
  437. # else
  438. # define OPENSSL_EXIT(n) do { EXIT(n); return(n); } while(0)
  439. # endif
  440. #endif
  441. /***********************************************/
  442. /* do we need to do this for getenv.
  443. * Just define getenv for use under windows */
  444. #ifdef WIN16
  445. /* How to do this needs to be thought out a bit more.... */
  446. /*char *GETENV(char *);
  447. #define Getenv GETENV*/
  448. #define Getenv getenv
  449. #else
  450. #define Getenv getenv
  451. #endif
  452. #define DG_GCC_BUG /* gcc < 2.6.3 on DGUX */
  453. #ifdef sgi
  454. #define IRIX_CC_BUG /* all version of IRIX I've tested (4.* 5.*) */
  455. #endif
  456. #ifdef OPENSSL_SYS_SNI
  457. #define IRIX_CC_BUG /* CDS++ up to V2.0Bsomething suffered from the same bug.*/
  458. #endif
  459. #if defined(OPENSSL_SYS_WINDOWS)
  460. # define strcasecmp _stricmp
  461. # define strncasecmp _strnicmp
  462. #elif defined(OPENSSL_SYS_VMS)
  463. /* VMS below version 7.0 doesn't have strcasecmp() */
  464. # include "o_str.h"
  465. # define strcasecmp OPENSSL_strcasecmp
  466. # define strncasecmp OPENSSL_strncasecmp
  467. # define OPENSSL_IMPLEMENTS_strncasecmp
  468. #elif defined(OPENSSL_SYS_OS2) && defined(__EMX__)
  469. # define strcasecmp stricmp
  470. # define strncasecmp strnicmp
  471. #else
  472. # ifdef NO_STRINGS_H
  473. int strcasecmp();
  474. int strncasecmp();
  475. # else
  476. # include <strings.h>
  477. # endif /* NO_STRINGS_H */
  478. #endif
  479. #if defined(OPENSSL_SYS_OS2) && defined(__EMX__)
  480. # include <io.h>
  481. # include <fcntl.h>
  482. # define NO_SYSLOG
  483. #endif
  484. /* vxworks */
  485. #if defined(OPENSSL_SYS_VXWORKS)
  486. #include <ioLib.h>
  487. #include <tickLib.h>
  488. #include <sysLib.h>
  489. #define TTY_STRUCT int
  490. #define sleep(a) taskDelay((a) * sysClkRateGet())
  491. #include <vxWorks.h>
  492. #include <sockLib.h>
  493. #include <taskLib.h>
  494. #define getpid taskIdSelf
  495. /* NOTE: these are implemented by helpers in database app!
  496. * if the database is not linked, we need to implement them
  497. * elswhere */
  498. struct hostent *gethostbyname(const char *name);
  499. struct hostent *gethostbyaddr(const char *addr, int length, int type);
  500. struct servent *getservbyname(const char *name, const char *proto);
  501. #endif
  502. /* end vxworks */
  503. #ifdef __cplusplus
  504. }
  505. #endif
  506. #endif