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");
|
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 static native void configureBlocking(int fd, boolean blocking) throws IOException;
591
592 public static void configureBlocking(FileDescriptor fd, boolean blocking) throws IOException {
593 configureBlocking(fdVal(fd), blocking);
594 }
595
596 public static native int fdVal(FileDescriptor fd);
597
598 static native void setfdVal(FileDescriptor fd, int value);
599
600 static native int fdLimit();
601
602 static native int iovMax();
603
604 static native long writevMax();
605
606 static native void initIDs();
607
608 /**
609 * Used to trigger loading of native libraries
610 */
611 public static void load() { }
612
613 static {
614 jdk.internal.loader.BootLoader.loadLibrary("net");
|