< prev index next >

src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c

Print this page


   1 /*
   2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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


 109 int
 110 dbgsysRecv(int fd, char *buf, size_t nBytes, int flags) {
 111     int rv;
 112     do {
 113         rv = recv(fd, buf, nBytes, flags);
 114     } while (rv == -1 && errno == EINTR);
 115 
 116     return rv;
 117 }
 118 
 119 int
 120 dbgsysSend(int fd, char *buf, size_t nBytes, int flags) {
 121     int rv;
 122     do {
 123         rv = send(fd, buf, nBytes, flags);
 124     } while (rv == -1 && errno == EINTR);
 125 
 126     return rv;
 127 }
 128 
 129 struct hostent *
 130 dbgsysGetHostByName(char *hostname) {
 131     return gethostbyname(hostname);


 132 }
 133 
 134 unsigned short
 135 dbgsysHostToNetworkShort(unsigned short hostshort) {
 136     return htons(hostshort);
 137 }
 138 
 139 int
 140 dbgsysSocket(int domain, int type, int protocol) {
 141     return socket(domain, type, protocol);
 142 }
 143 
 144 int dbgsysSocketClose(int fd) {
 145     int rv;
 146     do {
 147         rv = close(fd);
 148     } while (rv == -1 && errno == EINTR);
 149 
 150     return rv;
 151 }


   1 /*
   2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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


 109 int
 110 dbgsysRecv(int fd, char *buf, size_t nBytes, int flags) {
 111     int rv;
 112     do {
 113         rv = recv(fd, buf, nBytes, flags);
 114     } while (rv == -1 && errno == EINTR);
 115 
 116     return rv;
 117 }
 118 
 119 int
 120 dbgsysSend(int fd, char *buf, size_t nBytes, int flags) {
 121     int rv;
 122     do {
 123         rv = send(fd, buf, nBytes, flags);
 124     } while (rv == -1 && errno == EINTR);
 125 
 126     return rv;
 127 }
 128 
 129 int
 130 dbgsysGetAddrInfo(char *hostname, char *service,
 131                   struct addrinfo *hints,
 132                   struct addrinfo **results) {
 133     return getaddrinfo(hostname, service, hints, results);
 134 }
 135 
 136 unsigned short
 137 dbgsysHostToNetworkShort(unsigned short hostshort) {
 138     return htons(hostshort);
 139 }
 140 
 141 int
 142 dbgsysSocket(int domain, int type, int protocol) {
 143     return socket(domain, type, protocol);
 144 }
 145 
 146 int dbgsysSocketClose(int fd) {
 147     int rv;
 148     do {
 149         rv = close(fd);
 150     } while (rv == -1 && errno == EINTR);
 151 
 152     return rv;
 153 }


< prev index next >