src/solaris/native/java/net/net_util_md.h

Print this page
rev 8725 : 8024854: Basic changes and files to build the class library on AIX
Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, thomas.stuefe@sap.com
Reviewed-by: alanb, prr, sla, chegar, michaelm, mullan


  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef NET_UTILS_MD_H
  27 #define NET_UTILS_MD_H
  28 
  29 #include <sys/socket.h>
  30 #include <sys/types.h>
  31 #include <netdb.h>
  32 #include <netinet/in.h>
  33 #include <unistd.h>
  34 
  35 #ifndef USE_SELECT
  36 #include <sys/poll.h>
  37 #endif
  38 
  39 
  40 #if defined(__linux__) || defined(MACOSX)










  41 extern int NET_Timeout(int s, long timeout);
  42 extern int NET_Read(int s, void* buf, size_t len);
  43 extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
  44        struct sockaddr *from, int *fromlen);
  45 extern int NET_ReadV(int s, const struct iovec * vector, int count);
  46 extern int NET_Send(int s, void *msg, int len, unsigned int flags);
  47 extern int NET_SendTo(int s, const void *msg, int len,  unsigned  int
  48        flags, const struct sockaddr *to, int tolen);
  49 extern int NET_Writev(int s, const struct iovec * vector, int count);
  50 extern int NET_Connect(int s, struct sockaddr *addr, int addrlen);
  51 extern int NET_Accept(int s, struct sockaddr *addr, int *addrlen);
  52 extern int NET_SocketClose(int s);
  53 extern int NET_Dup2(int oldfd, int newfd);
  54 
  55 #ifdef USE_SELECT
  56 extern int NET_Select(int s, fd_set *readfds, fd_set *writefds,
  57                fd_set *exceptfds, struct timeval *timeout);
  58 #else
  59 extern int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout);
  60 #endif




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef NET_UTILS_MD_H
  27 #define NET_UTILS_MD_H
  28 
  29 #include <sys/socket.h>
  30 #include <sys/types.h>
  31 #include <netdb.h>
  32 #include <netinet/in.h>
  33 #include <unistd.h>
  34 
  35 #ifndef USE_SELECT
  36 #include <sys/poll.h>
  37 #endif
  38 
  39 
  40 /*
  41    AIX needs a workaround for I/O cancellation, see:
  42    http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/close.htm
  43    ...
  44    The close subroutine is blocked until all subroutines which use the file
  45    descriptor return to usr space. For example, when a thread is calling close
  46    and another thread is calling select with the same file descriptor, the
  47    close subroutine does not return until the select call returns.
  48    ...
  49 */
  50 #if defined(__linux__) || defined(MACOSX) || defined (_AIX)
  51 extern int NET_Timeout(int s, long timeout);
  52 extern int NET_Read(int s, void* buf, size_t len);
  53 extern int NET_RecvFrom(int s, void *buf, int len, unsigned int flags,
  54        struct sockaddr *from, int *fromlen);
  55 extern int NET_ReadV(int s, const struct iovec * vector, int count);
  56 extern int NET_Send(int s, void *msg, int len, unsigned int flags);
  57 extern int NET_SendTo(int s, const void *msg, int len,  unsigned  int
  58        flags, const struct sockaddr *to, int tolen);
  59 extern int NET_Writev(int s, const struct iovec * vector, int count);
  60 extern int NET_Connect(int s, struct sockaddr *addr, int addrlen);
  61 extern int NET_Accept(int s, struct sockaddr *addr, int *addrlen);
  62 extern int NET_SocketClose(int s);
  63 extern int NET_Dup2(int oldfd, int newfd);
  64 
  65 #ifdef USE_SELECT
  66 extern int NET_Select(int s, fd_set *readfds, fd_set *writefds,
  67                fd_set *exceptfds, struct timeval *timeout);
  68 #else
  69 extern int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout);
  70 #endif