Exemplo n.º 1
0
 /** @inheritDoc */
 public void close(int fd) throws IOException {
   // NOTE: this would block the VM. A real implementation should
   // make this a async native method.
   sockets.shutdown(fd, 2);
   libc.close(fd);
   if (DEBUG) {
     System.out.println("close(" + fd + ")");
   }
 }
Exemplo n.º 2
0
 /** Read errno, try to clean up fd, and create exception. */
 private IOException newError(int fd, String msg) {
   if (DEBUG) {
     VM.print(msg);
     VM.print(": errno: ");
   }
   int err_code = LibCUtil.errno();
   if (DEBUG) {
     VM.print(err_code);
     VM.println();
   }
   sockets.shutdown(fd, 2);
   libc.close(fd);
   return new IOException(" errno: " + err_code + " on fd: " + fd + " during " + msg);
 }