1 // win32.h -- Helper functions for Microsoft-flavored OSs.
3 /* Copyright (C) 2002 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 #ifndef __JV_WIN32_H__
12 #define __JV_WIN32_H__
17 #undef __INSIDE_CYGWIN__
21 #include <java/util/Properties.h>
25 // Prefix and suffix for shared libraries.
26 #define _Jv_platform_solib_prefix ""
27 #define _Jv_platform_solib_suffix ".dll"
29 #ifndef DISABLE_JAVA_NET
31 // these errors cannot occur on Win32
36 #define ENOPROTOOPT 109
39 #endif // DISABLE_JAVA_NET
41 extern void _Jv_platform_initialize (void);
42 extern void _Jv_platform_initProperties (java::util::Properties*);
43 extern jlong _Jv_platform_gettimeofday ();
46 _Jv_platform_close_on_exec (jint)
51 #ifdef JV_HASH_SYNCHRONIZATION
52 /* Suspends the execution of the current thread for the specified
53 number of microseconds. Tries to emulate the behaviour of usleep()
54 on UNIX and provides a granularity of 1 millisecond. */
56 _Jv_platform_usleep (unsigned long usecs)
60 unsigned long millis = ((usecs + 999UL) / 1000UL);
64 #endif /* JV_HASH_SYNCHRONIZATION */
66 #ifndef DISABLE_JAVA_NET
69 _Jv_socket (int domain, int type, int protocol)
71 return ::socket (domain, type, protocol);
75 _Jv_connect (jint fd, sockaddr *ptr, int len)
77 return ::connect (fd, ptr, len);
83 return ::closesocket (fd);
87 _Jv_bind (int fd, struct sockaddr *addr, int addrlen)
89 return ::bind (fd, addr, addrlen);
93 _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
95 return ::accept (fd, addr, addrlen);
99 _Jv_listen (int fd, int backlog)
101 return ::listen (fd, backlog);
105 _Jv_write(int s, void *buf, int len)
107 return ::send (s, (char*) buf, len, 0);
111 _Jv_read(int s, void *buf, int len)
113 return ::recv (s, (char*) buf, len, 0);
116 #endif /* DISABLE_JAVA_NET */
118 #define HAVE_BACKTRACE
120 /* Store up to SIZE return address of the current program state in
121 ARRAY and return the exact number of values stored. */
122 extern int backtrace (void **__array, int __size);
124 #endif /* __JV_WIN32_H__ */