570 /**
571 * Returns two file descriptors for a pipe encoded in a long.
572 * The read end of the pipe is returned in the high 32 bits,
573 * while the write end is returned in the low 32 bits.
574 */
575 static native long makePipe(boolean blocking) throws IOException;
576
577 static native int write1(int fd, byte b) throws IOException;
578
579 /**
580 * Read and discard all bytes.
581 */
582 static native boolean drain(int fd) throws IOException;
583
584 /**
585 * Read and discard at most one byte
586 * @return the number of bytes read or IOS_INTERRUPTED
587 */
588 static native int drain1(int fd) throws IOException;
589
590 public static native void configureBlocking(FileDescriptor fd,
591 boolean blocking)
592 throws IOException;
593
594 public static native int fdVal(FileDescriptor fd);
595
596 static native void setfdVal(FileDescriptor fd, int value);
597
598 static native int fdLimit();
599
600 static native int iovMax();
601
602 static native long writevMax();
603
604 static native void initIDs();
605
606 /**
607 * Used to trigger loading of native libraries
608 */
609 public static void load() { }
610
611 static {
612 jdk.internal.loader.BootLoader.loadLibrary("net");
613 jdk.internal.loader.BootLoader.loadLibrary("nio");
|
570 /**
571 * Returns two file descriptors for a pipe encoded in a long.
572 * The read end of the pipe is returned in the high 32 bits,
573 * while the write end is returned in the low 32 bits.
574 */
575 static native long makePipe(boolean blocking) throws IOException;
576
577 static native int write1(int fd, byte b) throws IOException;
578
579 /**
580 * Read and discard all bytes.
581 */
582 static native boolean drain(int fd) throws IOException;
583
584 /**
585 * Read and discard at most one byte
586 * @return the number of bytes read or IOS_INTERRUPTED
587 */
588 static native int drain1(int fd) throws IOException;
589
590 public static native void configureBlocking(FileDescriptor fd, boolean blocking)
591 throws IOException;
592
593 public static void configureBlocking(int fd, boolean blocking) throws IOException {
594 configureBlocking(newFD(fd), blocking);
595 }
596
597 public static native int fdVal(FileDescriptor fd);
598
599 static native void setfdVal(FileDescriptor fd, int value);
600
601 static native int fdLimit();
602
603 static native int iovMax();
604
605 static native long writevMax();
606
607 static native void initIDs();
608
609 /**
610 * Used to trigger loading of native libraries
611 */
612 public static void load() { }
613
614 static {
615 jdk.internal.loader.BootLoader.loadLibrary("net");
616 jdk.internal.loader.BootLoader.loadLibrary("nio");
|