src/os/linux/vm/hpi_linux.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2005, 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.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 



  25 //
  26 // Because the interruptible IO has been dropped for HotSpot/Linux,
  27 // the following HPI interface is very different from HotSparc.
  28 //
  29 
  30 #include <unistd.h>
  31 #include <sys/socket.h>
  32 #include <sys/poll.h>
  33 #include <sys/ioctl.h>
  34 #include <netdb.h>
  35 
  36 // HPI_FileInterface
  37 
  38 inline int hpi::close(int fd) {
  39   return ::close(fd);
  40 }
  41 
  42 inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
  43   size_t res;
  44   RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);


 205                              char *optval, int* optlen){
 206   return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
 207 }
 208 
 209 /*
 210 HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
 211         (int fd, int level, int optname, const char *optval, int optlen),
 212         ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
 213          fd, level, optname, optval, optlen),
 214         (fd, level, optname, optval, optlen));
 215         */
 216 inline int hpi::set_sock_opt(int fd, int level, int optname,
 217                              const char *optval, int optlen){
 218   return ::setsockopt(fd, level, optname, optval, optlen);
 219 }
 220 
 221 
 222 // Reconciliation History
 223 // hpi_solaris.hpp      1.9 99/08/30 16:31:23
 224 // End


   1 /*
   2  * Copyright (c) 1999, 2010, 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.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef OS_LINUX_VM_HPI_LINUX_HPP
  26 #define OS_LINUX_VM_HPI_LINUX_HPP
  27 
  28 //
  29 // Because the interruptible IO has been dropped for HotSpot/Linux,
  30 // the following HPI interface is very different from HotSparc.
  31 //
  32 
  33 #include <unistd.h>
  34 #include <sys/socket.h>
  35 #include <sys/poll.h>
  36 #include <sys/ioctl.h>
  37 #include <netdb.h>
  38 
  39 // HPI_FileInterface
  40 
  41 inline int hpi::close(int fd) {
  42   return ::close(fd);
  43 }
  44 
  45 inline size_t hpi::read(int fd, void *buf, unsigned int nBytes) {
  46   size_t res;
  47   RESTARTABLE( (size_t) ::read(fd, buf, (size_t) nBytes), res);


 208                              char *optval, int* optlen){
 209   return ::getsockopt(fd, level, optname, optval, (socklen_t *)optlen);
 210 }
 211 
 212 /*
 213 HPIDECL(set_sock_opt, "set_sock_opt", _socket, SocketSetOption, int, "%d",
 214         (int fd, int level, int optname, const char *optval, int optlen),
 215         ("fd = %d, level = %d, optname = %d, optval = %p, optlen = %d",
 216          fd, level, optname, optval, optlen),
 217         (fd, level, optname, optval, optlen));
 218         */
 219 inline int hpi::set_sock_opt(int fd, int level, int optname,
 220                              const char *optval, int optlen){
 221   return ::setsockopt(fd, level, optname, optval, optlen);
 222 }
 223 
 224 
 225 // Reconciliation History
 226 // hpi_solaris.hpp      1.9 99/08/30 16:31:23
 227 // End
 228 
 229 #endif // OS_LINUX_VM_HPI_LINUX_HPP