/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | FileDispatcherImpl.java | 50 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument 53 return read0(fd, address, len); in read() 56 int pread(FileDescriptor fd, long address, int len, long position) in pread() argument 61 return pread0(fd, address, len, position); in pread() 64 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument 67 return readv0(fd, address, len); in readv() 70 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument 73 return write0(fd, address, len); in write() 76 int pwrite(FileDescriptor fd, long address, int len, long position) in pwrite() argument 81 return pwrite0(fd, address, len, position); in pwrite() [all …]
|
D | DatagramDispatcher.java | 45 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument 48 return read0(fd, address, len); in read() 51 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument 54 return readv0(fd, address, len); in readv() 57 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument 60 return write0(fd, address, len); in write() 63 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument 66 return writev0(fd, address, len); in writev() 69 void close(FileDescriptor fd) throws IOException { in close() argument 70 FileDispatcherImpl.close0(fd); in close() [all …]
|
D | Net.java | 280 static void setSocketOption(FileDescriptor fd, ProtocolFamily family, 295 ExtendedOptionsImpl.setFlowOption(fd, (SocketFlow)value); 343 setIntOption0(fd, mayNeedConversion, key.level(), key.name(), arg, isIPv6); 346 static Object getSocketOption(FileDescriptor fd, ProtocolFamily family, 358 ExtendedOptionsImpl.getFlowOption(fd, flow); 372 int value = getIntOption0(fd, mayNeedConversion, key.level(), key.name()); 431 public static void bind(FileDescriptor fd, InetAddress addr, int port) 434 bind(UNSPEC, fd, addr, port); 437 static void bind(ProtocolFamily family, FileDescriptor fd, 442 bind0(fd, preferIPv6, exclusiveBind, addr, port); [all …]
|
D | SocketDispatcher.java | 40 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument 43 return FileDispatcherImpl.read0(fd, address, len); in read() 46 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument 49 return FileDispatcherImpl.readv0(fd, address, len); in readv() 52 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument 55 return FileDispatcherImpl.write0(fd, address, len); in write() 58 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument 61 return FileDispatcherImpl.writev0(fd, address, len); in writev() 64 void close(FileDescriptor fd) throws IOException { in close() argument 65 FileDispatcherImpl.close0(fd); in close() [all …]
|
D | NativeDispatcher.java | 38 abstract int read(FileDescriptor fd, long address, int len) in read() argument 49 int pread(FileDescriptor fd, long address, int len, long position) in pread() argument 55 abstract long readv(FileDescriptor fd, long address, int len) in readv() argument 58 abstract int write(FileDescriptor fd, long address, int len) in write() argument 61 int pwrite(FileDescriptor fd, long address, int len, long position) in pwrite() argument 67 abstract long writev(FileDescriptor fd, long address, int len) in writev() argument 70 abstract void close(FileDescriptor fd) throws IOException; in close() argument 76 void preClose(FileDescriptor fd) throws IOException { in preClose() argument
|
D | IOUtil.java | 46 static int write(FileDescriptor fd, ByteBuffer src, long position, in write() argument 51 return writeFromNativeBuffer(fd, src, position, nd); in write() 65 int n = writeFromNativeBuffer(fd, bb, position, nd); in write() 76 private static int writeFromNativeBuffer(FileDescriptor fd, ByteBuffer bb, in writeFromNativeBuffer() argument 89 written = nd.pwrite(fd, in writeFromNativeBuffer() 93 written = nd.write(fd, ((DirectBuffer)bb).address() + pos, rem); in writeFromNativeBuffer() 100 static long write(FileDescriptor fd, ByteBuffer[] bufs, NativeDispatcher nd) in write() argument 103 return write(fd, bufs, 0, bufs.length, nd); in write() 106 static long write(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length, in write() argument 148 long bytesWritten = nd.writev(fd, vec.address, iov_len); in write() [all …]
|
D | SocketChannelImpl.java | 74 private final FileDescriptor fd; field in SocketChannelImpl 130 this.fd = Net.socket(true); in SocketChannelImpl() 131 this.fdVal = IOUtil.fdVal(fd); in SocketChannelImpl() 136 if (fd != null && fd.valid()) { in SocketChannelImpl() 142 FileDescriptor fd, in SocketChannelImpl() argument 147 this.fd = fd; in SocketChannelImpl() 148 this.fdVal = IOUtil.fdVal(fd); in SocketChannelImpl() 152 if (fd != null && fd.valid()) { in SocketChannelImpl() 157 this.localAddress = Net.localAddress(fd); in SocketChannelImpl() 163 FileDescriptor fd, InetSocketAddress remote) in SocketChannelImpl() argument [all …]
|
D | DatagramChannelImpl.java | 60 final FileDescriptor fd; field in DatagramChannelImpl 127 this.fd = Net.socket(family, false); in DatagramChannelImpl() 128 this.fdVal = IOUtil.fdVal(fd); in DatagramChannelImpl() 131 if (fd != null && fd.valid()) { in DatagramChannelImpl() 158 this.fd = Net.socket(family, false); in DatagramChannelImpl() 159 this.fdVal = IOUtil.fdVal(fd); in DatagramChannelImpl() 162 if (fd != null && fd.valid()) { in DatagramChannelImpl() 167 public DatagramChannelImpl(SelectorProvider sp, FileDescriptor fd) in DatagramChannelImpl() argument 173 this.fd = fd; in DatagramChannelImpl() 174 this.fdVal = IOUtil.fdVal(fd); in DatagramChannelImpl() [all …]
|
D | Port.java | 64 final void register(int fd, PollableChannel ch) { in register() argument 69 fdToChannel.put(Integer.valueOf(fd), ch); in register() 79 protected void preUnregister(int fd) { in preUnregister() argument 86 final void unregister(int fd) { in unregister() argument 89 preUnregister(fd); in unregister() 93 fdToChannel.remove(Integer.valueOf(fd)); in unregister() 114 abstract void startPoll(int fd, int events); in startPoll() argument 127 final Object attachForeignChannel(final Channel channel, FileDescriptor fd) { in attachForeignChannel() argument 128 int fdVal = IOUtil.fdVal(fd); in attachForeignChannel() 157 for (Integer fd: fdToChannel.keySet()) { in closeAllChannels() [all …]
|
/libcore/luni/src/main/java/libcore/io/ |
D | ForwardingOs.java | 69 …scriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketExcepti… in accept() argument 74 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument 75 …public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException … in bind() argument 88 public void close(FileDescriptor fd) throws ErrnoException { os.close(fd); } in close() argument 89 …_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long newOwnerId) { os.android_fdsan_e… in android_fdsan_exchange_owner_tag() argument 90 …blic long android_fdsan_get_owner_tag(FileDescriptor fd) { return os.android_fdsan_get_owner_tag(f… in android_fdsan_get_owner_tag() argument 94 …lic void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in connect() argument 95 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument 101 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException { os.fchmod(fd, mode); } in fchmod() argument 102 …public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { os.fchown(fd, uid,… in fchown() argument [all …]
|
D | Linux.java | 50 …public native FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoExce… in accept() argument 53 …public native void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, S… in bind() argument 54 …public native void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExc… in bind() argument 63 public native void close(FileDescriptor fd) throws ErrnoException; in close() argument 64 …public native void android_fdsan_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long … in android_fdsan_exchange_owner_tag() argument 65 public native long android_fdsan_get_owner_tag(FileDescriptor fd); in android_fdsan_get_owner_tag() argument 69 …public native void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException… in connect() argument 70 …public native void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, Socket… in connect() argument 76 public native void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument 77 public native void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument [all …]
|
D | IoBridge.java | 62 public static int available(FileDescriptor fd) throws IOException { in available() argument 65 Libcore.os.ioctlInt(fd, FIONREAD, available); in available() 86 … public static void bind(FileDescriptor fd, InetAddress address, int port) throws SocketException { in bind() argument 104 Libcore.os.bind(fd, address, port); in bind() 120 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port) throws SocketExce… in connect() argument 122 IoBridge.connect(fd, inetAddress, port, 0); in connect() 132 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs) th… in connect() argument 134 connectErrno(fd, inetAddress, port, timeoutMs); in connect() 142 throw new ConnectException(createMessageForException(fd, inetAddress, port, timeoutMs, in connect() 153 …private static void connectErrno(FileDescriptor fd, InetAddress inetAddress, int port, int timeout… in connectErrno() argument [all …]
|
D | BlockGuardOs.java | 52 private FileDescriptor tagSocket(FileDescriptor fd) throws ErrnoException { in tagSocket() argument 54 SocketTagger.get().tag(fd); in tagSocket() 55 return fd; in tagSocket() 61 …@Override public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoE… in accept() argument 63 final FileDescriptor acceptFd = super.accept(fd, peerAddress); in accept() 91 @Override public void close(FileDescriptor fd) throws ErrnoException { in close() argument 96 if (fd.isSocket$()) { in close() 97 if (isLingerSocket(fd)) { in close() 110 super.close(fd); in close() 113 private static boolean isInetSocket(FileDescriptor fd) throws ErrnoException{ in isInetSocket() argument [all …]
|
D | Os.java | 50 …public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, … in accept() argument 53 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument 54 … public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException; in bind() argument 62 public void close(FileDescriptor fd) throws ErrnoException; in close() argument 63 …public void android_fdsan_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long newOwne… in android_fdsan_exchange_owner_tag() argument 64 public long android_fdsan_get_owner_tag(FileDescriptor fd); in android_fdsan_get_owner_tag() argument 69 …public void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, Socke… in connect() argument 70 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument 76 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument 77 public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument [all …]
|
D | IoUtils.java | 59 public static int acquireRawFd(@NonNull FileDescriptor fd) { in acquireRawFd() argument 60 Objects.requireNonNull(fd); in acquireRawFd() 62 FileDescriptor copy = fd.release$(); in acquireRawFd() 135 public static void setFdOwner(@NonNull FileDescriptor fd, @NonNull Object owner) { in setFdOwner() argument 136 Objects.requireNonNull(fd); in setFdOwner() 139 long previousOwnerId = fd.getOwnerId$(); in setFdOwner() 146 fd.setOwnerId$(ownerId); in setFdOwner() 149 Libcore.os.android_fdsan_exchange_owner_tag(fd, previousOwnerId, ownerId); in setFdOwner() 157 public static void close(FileDescriptor fd) throws IOException { in close() argument 158 IoBridge.closeAndSignalBlockedThreads(fd); in close() [all …]
|
/libcore/luni/src/main/java/android/system/ |
D | Os.java | 47 …criptor accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketExce… in accept() argument 53 …ptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException {… in accept() argument 66 …tic void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcep… in bind() argument 71 …bind(@NonNull FileDescriptor fd, @NonNull SocketAddress address) throws ErrnoException, SocketExce… in bind() argument 107 public static void close(FileDescriptor fd) throws ErrnoException { Libcore.os.close(fd); } in close() argument 112 …void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcept… in connect() argument 117 …ct(@NonNull FileDescriptor fd, @NonNull SocketAddress address) throws ErrnoException, SocketExcept… in connect() argument 147 …public static void fchmod(FileDescriptor fd, int mode) throws ErrnoException { Libcore.os.fchmod(f… in fchmod() argument 152 …public static void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { Libcore.os.… in fchown() argument 157 …c int fcntlInt(@NonNull FileDescriptor fd, int cmd, int arg) throws ErrnoException { return Libcor… in fcntlInt() argument [all …]
|
/libcore/ojluni/src/main/native/ |
D | io_util_md.c | 75 FD fd; in handleOpen() local 76 RESTARTABLE(open64(path, oflag, mode), fd); in handleOpen() 77 if (fd != -1) { in handleOpen() 80 RESTARTABLE(fstat64(fd, &buf64), result); in handleOpen() 83 close(fd); in handleOpen() 85 fd = -1; in handleOpen() 88 close(fd); in handleOpen() 89 fd = -1; in handleOpen() 92 return fd; in handleOpen() 100 FD fd; in fileOpen() local [all …]
|
D | FileDispatcherImpl.c | 69 jint fd = fdval(env, fdo); in FileDispatcherImpl_read0() local 72 return convertReturnVal(env, read(fd, buf, len), JNI_TRUE); in FileDispatcherImpl_read0() 79 jint fd = fdval(env, fdo); in FileDispatcherImpl_pread0() local 82 return convertReturnVal(env, pread64(fd, buf, len, offset), JNI_TRUE); in FileDispatcherImpl_pread0() 89 jint fd = fdval(env, fdo); in FileDispatcherImpl_readv0() local 91 return convertLongReturnVal(env, readv(fd, iov, len), JNI_TRUE); in FileDispatcherImpl_readv0() 98 jint fd = fdval(env, fdo); in FileDispatcherImpl_write0() local 101 return convertReturnVal(env, write(fd, buf, len), JNI_FALSE); in FileDispatcherImpl_write0() 108 jint fd = fdval(env, fdo); in FileDispatcherImpl_pwrite0() local 111 return convertReturnVal(env, pwrite64(fd, buf, len, offset), JNI_FALSE); in FileDispatcherImpl_pwrite0() [all …]
|
D | FileSystemPreferences.c | 72 int fd, rc; in Java_java_util_prefs_FileSystemPreferences_lockFile0() local 88 fd = open(fname, O_RDONLY, 0); in Java_java_util_prefs_FileSystemPreferences_lockFile0() 91 fd = open(fname, O_WRONLY|O_CREAT, permission); in Java_java_util_prefs_FileSystemPreferences_lockFile0() 96 if (fd < 0) { in Java_java_util_prefs_FileSystemPreferences_lockFile0() 102 rc = fcntl(fd, F_SETLK, &fl); in Java_java_util_prefs_FileSystemPreferences_lockFile0() 104 rc = fcntl(fd, F_SETLK64, &fl); in Java_java_util_prefs_FileSystemPreferences_lockFile0() 109 close(fd); in Java_java_util_prefs_FileSystemPreferences_lockFile0() 111 result[0] = fd; in Java_java_util_prefs_FileSystemPreferences_lockFile0() 126 jclass thisclass, jint fd) { in Java_java_util_prefs_FileSystemPreferences_unlockFile0() argument 137 rc = fcntl(fd, F_SETLK, &fl); in Java_java_util_prefs_FileSystemPreferences_unlockFile0() [all …]
|
D | io_util.c | 43 FD fd = GET_FD(this, fid); in readSingle() local 44 if (fd == -1) { in readSingle() 48 nread = (jint)IO_Read(fd, &ret, 1); in readSingle() 83 FD fd; in readBytes() local 107 fd = GET_FD(this, fid); in readBytes() 108 if (fd == -1) { in readBytes() 112 nread = (jint)IO_Read(fd, buf, len); in readBytes() 135 FD fd = GET_FD(this, fid); in writeSingle() local 136 if (fd == -1) { in writeSingle() 141 n = (jint)IO_Append(fd, &c, 1); in writeSingle() [all …]
|
/libcore/ojluni/src/main/java/java/net/ |
D | PlainSocketImpl.java | 76 this.fd = new FileDescriptor(); in PlainSocketImpl() 128 fd.setInt$(IoBridge.socket(AF_INET6, isStream ? SOCK_STREAM : SOCK_DGRAM, 0).getInt$()); in socketCreate() 129 IoUtils.setFdOwner(fd, this); in socketCreate() 132 IoUtils.setBlocking(fd, false); in socketCreate() 133 IoBridge.setSocketOption(fd, SO_REUSEADDR, true); in socketCreate() 138 if (fd == null || !fd.valid()) { in socketConnect() 142 IoBridge.connect(fd, address, port, timeout); in socketConnect() 152 localport = IoBridge.getLocalInetSocketAddress(fd).getPort(); in socketConnect() 158 if (fd == null || !fd.valid()) { in socketBind() 162 IoBridge.bind(fd, address, port); in socketBind() [all …]
|
/libcore/luni/src/test/java/libcore/android/system/ |
D | OsTest.java | 91 final FileDescriptor fd = Os.socket(AF_INET, SOCK_DGRAM, 0); in testFcntlInt_udpSocket() local 93 assertEquals(0, (Os.fcntlVoid(fd, F_GETFL) & O_NONBLOCK)); in testFcntlInt_udpSocket() 96 Os.fcntlInt(fd, F_SETFL, SOCK_DGRAM | O_NONBLOCK); in testFcntlInt_udpSocket() 97 assertTrue((Os.fcntlVoid(fd, F_GETFL) & O_NONBLOCK) != 0); in testFcntlInt_udpSocket() 100 Os.fcntlInt(fd, F_SETFL, SOCK_DGRAM); in testFcntlInt_udpSocket() 101 assertEquals(0, (Os.fcntlVoid(fd, F_GETFL) & O_NONBLOCK)); in testFcntlInt_udpSocket() 103 Os.close(fd); in testFcntlInt_udpSocket() 108 final FileDescriptor fd = Os.socket(AF_INET, SOCK_DGRAM, 0); in testFcntlInt_invalidCmd() local 111 Os.fcntlInt(fd, unknownCmd, 0); in testFcntlInt_invalidCmd() 116 Os.close(fd); in testFcntlInt_invalidCmd() [all …]
|
/libcore/luni/src/main/native/ |
D | AsynchronousCloseMonitor.cpp | 33 explicit AsynchronousCloseMonitorImpl(int fd); 39 static void signalBlockedThreads(int fd); 91 void AsynchronousCloseMonitorImpl::signalBlockedThreads(int fd) { in signalBlockedThreads() argument 94 if (it->mFd == fd) { in signalBlockedThreads() 106 AsynchronousCloseMonitorImpl::AsynchronousCloseMonitorImpl(int fd) { in AsynchronousCloseMonitorImpl() argument 110 mFd = fd; in AsynchronousCloseMonitorImpl() 145 void async_close_monitor_signal_blocked_threads(int fd) { in async_close_monitor_signal_blocked_threads() argument 146 AsynchronousCloseMonitorImpl::signalBlockedThreads(fd); in async_close_monitor_signal_blocked_threads() 149 void* async_close_monitor_create(int fd) { in async_close_monitor_create() argument 150 return new AsynchronousCloseMonitorImpl(fd); in async_close_monitor_create()
|
/libcore/ojluni/src/main/java/java/io/ |
D | FileOutputStream.java | 72 private final FileDescriptor fd; field in FileOutputStream 236 this.fd = IoBridge.open(name, flags); in FileOutputStream() 250 IoUtils.setFdOwner(this.fd, this); in FileOutputStream() 295 this.fd = fdObj; in FileOutputStream() 303 IoUtils.setFdOwner(this.fd, this); in FileOutputStream() 401 IoBridge.write(fd, b, off, len); in write() 434 IoBridge.closeAndSignalBlockedThreads(fd); in close() 452 if (fd != null) { in getFD() 453 return fd; in getFD() 478 channel = FileChannelImpl.open(fd, path, false, true, append, this); in getChannel() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/zip/ |
D | ZipFileTest.java | 48 FileDescriptor fd = new FileDescriptor(); in testZipFileOffsetNeverChangesAfterInit() local 49 fd.setInt$(zipFile.getFileDescriptor()); in testZipFileOffsetNeverChangesAfterInit() 51 long initialOffset = android.system.Os.lseek(fd, 0, OsConstants.SEEK_CUR); in testZipFileOffsetNeverChangesAfterInit() 54 assertOffset(initialOffset, fd); in testZipFileOffsetNeverChangesAfterInit() 60 assertOffset(initialOffset, fd); in testZipFileOffsetNeverChangesAfterInit() 63 assertOffset(initialOffset, fd); in testZipFileOffsetNeverChangesAfterInit() 65 assertOffset(initialOffset, fd); in testZipFileOffsetNeverChangesAfterInit() 69 assertOffset(initialOffset, fd); in testZipFileOffsetNeverChangesAfterInit() 74 private static void assertOffset(long initialOffset, FileDescriptor fd) throws Exception { in assertOffset() argument 75 long currentOffset = android.system.Os.lseek(fd, 0, OsConstants.SEEK_CUR); in assertOffset()
|