Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 137) sorted by relevance

123456

/libcore/ojluni/src/main/java/sun/nio/ch/
DFileDispatcherImpl.java50 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 …]
DDatagramDispatcher.java45 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 …]
DNet.java280 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 …]
DSocketDispatcher.java40 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 …]
DNativeDispatcher.java38 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
DIOUtil.java46 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 …]
DSocketChannelImpl.java74 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 …]
DDatagramChannelImpl.java60 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 …]
DPort.java64 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/
DForwardingOs.java93 …scriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketExcepti… in accept() argument
141 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument
146 …public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException … in bind() argument
179 public void close(FileDescriptor fd) throws ErrnoException { os.close(fd); } in close() argument
184 …_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long newOwnerId) { os.android_fdsan_e… in android_fdsan_exchange_owner_tag() argument
189 …blic long android_fdsan_get_owner_tag(FileDescriptor fd) { return os.android_fdsan_get_owner_tag(f… in android_fdsan_get_owner_tag() argument
204 …lic void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in connect() argument
209 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument
239 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException { os.fchmod(fd, mode); } in fchmod() argument
244 …public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { os.fchown(fd, uid,… in fchown() argument
[all …]
DIoBridge.java105 public static int available(FileDescriptor fd) throws IOException { in available() argument
107 int available = Libcore.os.ioctlInt(fd, FIONREAD); in available()
128 … public static void bind(FileDescriptor fd, InetAddress address, int port) throws SocketException { in bind() argument
146 Libcore.os.bind(fd, address, port); in bind()
164 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port) throws SocketExce… in connect() argument
166 IoBridge.connect(fd, inetAddress, port, 0); in connect()
178 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs) th… in connect() argument
180 connectErrno(fd, inetAddress, port, timeoutMs); in connect()
188 throw new ConnectException(createMessageForException(fd, inetAddress, port, timeoutMs, in connect()
199 …private static void connectErrno(FileDescriptor fd, InetAddress inetAddress, int port, int timeout… in connectErrno() argument
[all …]
DLinux.java51 …public native FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoExce… in accept() argument
54 …public native void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, S… in bind() argument
55 …public native void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExc… in bind() argument
64 public native void close(FileDescriptor fd) throws ErrnoException; in close() argument
65 …public native void android_fdsan_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long … in android_fdsan_exchange_owner_tag() argument
66 public native long android_fdsan_get_owner_tag(FileDescriptor fd); in android_fdsan_get_owner_tag() argument
70 …public native void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException… in connect() argument
71 …public native void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, Socket… in connect() argument
77 public native void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument
78 public native void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument
[all …]
DBlockGuardOs.java53 private FileDescriptor tagSocket(FileDescriptor fd) throws ErrnoException { in tagSocket() argument
55 SocketTagger.get().tag(fd); in tagSocket()
56 return fd; in tagSocket()
62 …@Override public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoE… in accept() argument
63 if (!(isUnixSocket(fd) && isNonBlockingFile(fd))) { in accept()
66 final FileDescriptor acceptFd = super.accept(fd, peerAddress); in accept()
94 @Override public void close(FileDescriptor fd) throws ErrnoException { in close() argument
99 if (fd.isSocket$()) { in close()
100 if (isLingerSocket(fd)) { in close()
113 super.close(fd); in close()
[all …]
DOs.java68 …public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, … in accept() argument
83 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument
88 … public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException; in bind() argument
115 public void close(FileDescriptor fd) throws ErrnoException; in close() argument
120 …public void android_fdsan_exchange_owner_tag(FileDescriptor fd, long previousOwnerId, long newOwne… in android_fdsan_exchange_owner_tag() argument
125 public long android_fdsan_get_owner_tag(FileDescriptor fd); in android_fdsan_get_owner_tag() argument
142 …public void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, Socke… in connect() argument
147 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument
177 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument
182 public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument
[all …]
DIoUtils.java69 public static int acquireRawFd(@NonNull FileDescriptor fd) { in acquireRawFd() argument
70 Objects.requireNonNull(fd); in acquireRawFd()
72 FileDescriptor copy = fd.release$(); in acquireRawFd()
155 public static void setFdOwner(@NonNull FileDescriptor fd, @NonNull Object owner) { in setFdOwner() argument
156 Objects.requireNonNull(fd); in setFdOwner()
159 long previousOwnerId = fd.getOwnerId$(); in setFdOwner()
166 fd.setOwnerId$(ownerId); in setFdOwner()
169 Libcore.os.android_fdsan_exchange_owner_tag(fd, previousOwnerId, ownerId); in setFdOwner()
183 public static void close(@Nullable FileDescriptor fd) throws IOException { in close() argument
184 IoBridge.closeAndSignalBlockedThreads(fd); in close()
[all …]
/libcore/luni/src/main/java/android/system/
DOs.java51 …criptor accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketExce… in accept() argument
57 …ptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException {… in accept() argument
70 …tic void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcep… in bind() argument
75 …bind(@NonNull FileDescriptor fd, @NonNull SocketAddress address) throws ErrnoException, SocketExce… in bind() argument
131 public static void close(FileDescriptor fd) throws ErrnoException { Libcore.os.close(fd); } in close() argument
136 …void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcept… in connect() argument
141 …ct(@NonNull FileDescriptor fd, @NonNull SocketAddress address) throws ErrnoException, SocketExcept… in connect() argument
171 …public static void fchmod(FileDescriptor fd, int mode) throws ErrnoException { Libcore.os.fchmod(f… in fchmod() argument
176 …public static void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { Libcore.os.… in fchown() argument
181 …c int fcntlInt(@NonNull FileDescriptor fd, int cmd, int arg) throws ErrnoException { return Libcor… in fcntlInt() argument
[all …]
/libcore/ojluni/src/main/native/
Dio_util_md.c75 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 …]
DFileDispatcherImpl.c69 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 …]
DFileSystemPreferences.c72 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 …]
Dio_util.c43 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/
DPlainSocketImpl.java76 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/main/native/
DAsynchronousCloseMonitor.cpp33 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/
DFileOutputStream.java72 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 …]
DFileInputStream.java64 private final FileDescriptor fd; field in FileInputStream
160 fd = IoBridge.open(name, O_RDONLY); in FileInputStream()
173 IoUtils.setFdOwner(this.fd, this); in FileInputStream()
213 fd = fdObj; in FileInputStream()
226 IoUtils.setFdOwner(this.fd, this); in FileInputStream()
323 return IoBridge.read(fd, b, off, len); in read()
434 IoBridge.closeAndSignalBlockedThreads(fd); in close()
450 if (fd != null) { in getFD()
451 return fd; in getFD()
475 channel = FileChannelImpl.open(fd, path, true, false, this); in getChannel()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DFileDescriptorTest.java43 FileDescriptor fd = fos.getFD(); in test_sync() local
44 fd.sync(); in test_sync()
50 fd = fis.getFD(); in test_sync()
51 fd.sync(); in test_sync()
55 fd = raf.getFD(); in test_sync()
56 fd.sync(); in test_sync()
79 FileDescriptor fd = fos.getFD(); in test_valid() local
80 assertTrue(fd.valid()); in test_valid()
82 assertFalse(fd.valid()); in test_valid()

123456