aboutsummaryrefslogtreecommitdiff
path: root/libjava/include/posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include/posix.h')
-rw-r--r--libjava/include/posix.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index cdcdb5d45ac..0aadd47d3b3 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -1,6 +1,6 @@
// posix.h -- Helper functions for POSIX-flavored OSs.
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -60,6 +60,16 @@ _Jv_platform_close_on_exec (jint fd)
::fcntl (fd, F_SETFD, FD_CLOEXEC);
}
+#undef fcntl
+
+#ifdef JV_HASH_SYNCHRONIZATION
+inline void
+_Jv_platform_usleep (unsigned long usecs)
+{
+ usleep (usecs);
+}
+#endif /* JV_HASH_SYNCHRONIZATION */
+
#ifndef DISABLE_JAVA_NET
#ifndef HAVE_SOCKLEN_T
@@ -72,18 +82,24 @@ _Jv_socket (int domain, int type, int protocol)
return ::socket (domain, type, protocol);
}
+#undef socket
+
inline int
_Jv_connect (jint fd, sockaddr *ptr, int len)
{
return ::connect (fd, ptr, len);
}
+#undef connect
+
inline int
_Jv_close (jint fd)
{
return ::close (fd);
}
+#undef close
+
// Avoid macro definitions of bind from system headers, e.g. on
// Solaris 7 with _XOPEN_SOURCE. FIXME
inline int
@@ -92,6 +108,8 @@ _Jv_bind (int fd, struct sockaddr *addr, int addrlen)
return ::bind (fd, addr, addrlen);
}
+#undef bind
+
// Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET
inline int
_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
@@ -99,24 +117,32 @@ _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
return ::accept (fd, addr, addrlen);
}
+#undef accept
+
inline int
_Jv_listen (int fd, int backlog)
{
return ::listen (fd, backlog);
}
+#undef listen
+
inline int
_Jv_write(int s, void *buf, int len)
{
return ::write (s, buf, len);
}
+#undef write
+
inline int
_Jv_read(int s, void *buf, int len)
{
return ::read (s, buf, len);
}
+#undef read
+
#endif /* DISABLE_JAVA_NET */
#endif /* __JV_POSIX_H__ */