jint JVM_Send(jint fd, char *buf, jint nBytes, jint flags)
{
- log_println("JVM_Send: IMPLEMENT ME!");
+ TRACEJVMCALLSENTER(("JVM_Send(fd=%d, buf=%p, nBytes=%d, flags=%d", fd, buf, nBytes, flags));
- return 0;
+ int result = os::send(fd, buf, nBytes, flags);
+
+ TRACEJVMCALLSEXIT(("->%d", result));
+
+ return result;
}
static inline int mprotect(void* addr, size_t len, int prot);
static inline ssize_t readlink(const char* path, char* buf, size_t bufsiz);
static inline int scandir(const char* dir, struct dirent*** namelist, int(*filter)(const struct dirent*), int(*compar)(const void*, const void*));
+ static inline ssize_t send(int s, const void* buf, size_t len, int flags);
static inline int setsockopt(int s, int level, int optname, const void* optval, socklen_t optlen);
static inline int shutdown(int s, int how);
static inline int socket(int domain, int type, int protocol);
#endif
}
+inline ssize_t os::send(int s, const void* buf, size_t len, int flags)
+{
+ // TODO Should be restartable on Linux and interruptible on Solaris.
+#if defined(HAVE_SEND)
+ return ::send(s, buf, len, flags);
+#else
+# error send not available
+#endif
+}
+
inline int os::setsockopt(int s, int level, int optname, const void* optval, socklen_t optlen)
{
#if defined(HAVE_SETSOCKOPT)