Home
last modified time | relevance | path

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

12345

/libcore/ojluni/src/main/java/sun/nio/ch/
DFileDispatcherImpl.java43 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument
45 return read0(fd, address, len); in read()
48 int pread(FileDescriptor fd, long address, int len, long position) in pread() argument
52 return pread0(fd, address, len, position); in pread()
55 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument
57 return readv0(fd, address, len); in readv()
60 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
62 return write0(fd, address, len); in write()
65 int pwrite(FileDescriptor fd, long address, int len, long position) in pwrite() argument
69 return pwrite0(fd, address, len, position); in pwrite()
[all …]
DDatagramDispatcher.java40 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument
42 return read0(fd, address, len); in read()
45 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument
47 return readv0(fd, address, len); in readv()
50 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
52 return write0(fd, address, len); in write()
55 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument
57 return writev0(fd, address, len); in writev()
60 void close(FileDescriptor fd) throws IOException { in close() argument
61 FileDispatcherImpl.close0(fd); in close()
[all …]
DSocketDispatcher.java41 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
48 return FileDispatcherImpl.readv0(fd, address, len); in readv()
51 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
53 return FileDispatcherImpl.write0(fd, address, len); in write()
56 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument
58 return FileDispatcherImpl.writev0(fd, address, len); in writev()
61 void close(FileDescriptor fd) throws IOException { in close() argument
62 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 …]
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 …]
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 …]
DSocketChannelImpl.java73 private final FileDescriptor fd; field in SocketChannelImpl
128 this.fd = Net.socket(true); in SocketChannelImpl()
129 this.fdVal = IOUtil.fdVal(fd); in SocketChannelImpl()
134 if (fd != null && fd.valid()) { in SocketChannelImpl()
140 FileDescriptor fd, in SocketChannelImpl() argument
145 this.fd = fd; in SocketChannelImpl()
146 this.fdVal = IOUtil.fdVal(fd); in SocketChannelImpl()
150 if (fd != null && fd.valid()) { in SocketChannelImpl()
155 this.localAddress = Net.localAddress(fd); in SocketChannelImpl()
161 FileDescriptor fd, InetSocketAddress remote) in SocketChannelImpl() argument
[all …]
DFileDispatcher.java39 abstract int force(FileDescriptor fd, boolean metaData) throws IOException; in force() argument
41 abstract int truncate(FileDescriptor fd, long size) throws IOException; in truncate() argument
43 abstract long size(FileDescriptor fd) throws IOException; in size() argument
45 abstract int lock(FileDescriptor fd, boolean blocking, long pos, long size, in lock() argument
48 abstract void release(FileDescriptor fd, long pos, long size) in release() argument
56 abstract FileDescriptor duplicateForMapping(FileDescriptor fd) in duplicateForMapping() argument
/libcore/luni/src/main/java/libcore/io/
DForwardingOs.java57 …scriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketExcepti… in accept() argument
60 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument
61 …public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException … in bind() argument
72 public void close(FileDescriptor fd) throws ErrnoException { os.close(fd); } in close() argument
73 …lic void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in connect() argument
74 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument
80 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException { os.fchmod(fd, mode); } in fchmod() argument
81 …public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { os.fchown(fd, uid,… in fchown() argument
82 …fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOExcept… in fcntlFlock() argument
83 …public int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException { return os.fcntlIn… in fcntlInt() 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
63 public native void close(FileDescriptor fd) throws ErrnoException; in close() argument
64 …public native void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException… in connect() argument
65 …public native void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, Socket… in connect() argument
71 public native void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument
72 public native void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument
73 …public native int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, I… in fcntlFlock() argument
74 public native int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException; in fcntlInt() argument
[all …]
DIoBridge.java58 public static int available(FileDescriptor fd) throws IOException { in available() argument
61 Libcore.os.ioctlInt(fd, FIONREAD, available); in available()
82 … public static void bind(FileDescriptor fd, InetAddress address, int port) throws SocketException { in bind() argument
100 Libcore.os.bind(fd, address, port); in bind()
116 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port) throws SocketExce… in connect() argument
118 IoBridge.connect(fd, inetAddress, port, 0); in connect()
128 …public static void connect(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs) th… in connect() argument
130 connectErrno(fd, inetAddress, port, timeoutMs); in connect()
138 throw new ConnectException(connectDetail(fd, inetAddress, port, timeoutMs, in connect()
149 …private static void connectErrno(FileDescriptor fd, InetAddress inetAddress, int port, int timeout… in connectErrno() argument
[all …]
DBlockGuardOs.java45 private FileDescriptor tagSocket(FileDescriptor fd) throws ErrnoException { in tagSocket() argument
47 SocketTagger.get().tag(fd); in tagSocket()
48 return fd; in tagSocket()
54 private void untagSocket(FileDescriptor fd) throws ErrnoException { in untagSocket() argument
56 SocketTagger.get().untag(fd); in untagSocket()
62 …@Override public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoE… in accept() argument
64 final FileDescriptor acceptFd = os.accept(fd, peerAddress); in accept()
86 @Override public void close(FileDescriptor fd) throws ErrnoException { in close() argument
91 if (fd.isSocket$()) { in close()
92 if (isLingerSocket(fd)) { in close()
[all …]
DOs.java48 …public FileDescriptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, … in accept() argument
51 …public void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketEx… in bind() argument
52 … public void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException; in bind() argument
57 public void close(FileDescriptor fd) throws ErrnoException; in close() argument
58 …public void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, Socke… in connect() argument
59 …public void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketExcepti… in connect() argument
65 public void fchmod(FileDescriptor fd, int mode) throws ErrnoException; in fchmod() argument
66 public void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException; in fchown() argument
67 …public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, Interrup… in fcntlFlock() argument
68 public int fcntlInt(FileDescriptor fd, int cmd, int arg) throws ErrnoException; in fcntlInt() argument
[all …]
DIoUtils.java40 public static void close(FileDescriptor fd) throws IOException { in close() argument
42 if (fd != null && fd.valid()) { in close()
43 Libcore.os.close(fd); in close()
67 public static void closeQuietly(FileDescriptor fd) { in closeQuietly() argument
69 IoUtils.close(fd); in closeQuietly()
89 public static void setBlocking(FileDescriptor fd, boolean blocking) throws IOException { in setBlocking() argument
91 int flags = Libcore.os.fcntlVoid(fd, F_GETFL); in setBlocking()
97 Libcore.os.fcntlInt(fd, F_SETFL, flags); in setBlocking()
163 FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0); in canOpenReadOnly() local
164 Libcore.os.close(fd); in canOpenReadOnly()
[all …]
/libcore/luni/src/main/java/android/system/
DOs.java43 …or accept(FileDescriptor fd, InetSocketAddress peerAddress) throws ErrnoException, SocketException… in accept() argument
49 …ptor accept(FileDescriptor fd, SocketAddress peerAddress) throws ErrnoException, SocketException {… in accept() argument
61 …tic void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcep… in bind() argument
63 … static void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException… in bind() argument
97 public static void close(FileDescriptor fd) throws ErrnoException { Libcore.os.close(fd); } in close() argument
102 …void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketExcept… in connect() argument
104 …tic void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException … in connect() argument
134 …public static void fchmod(FileDescriptor fd, int mode) throws ErrnoException { Libcore.os.fchmod(f… in fchmod() argument
139 …public static void fchown(FileDescriptor fd, int uid, int gid) throws ErrnoException { Libcore.os.… in fchown() argument
141 …lFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException, InterruptedIOException … in fcntlFlock() argument
[all …]
/libcore/ojluni/src/main/native/
Dio_util_md.c67 FD fd; in handleOpen() local
68 RESTARTABLE(open64(path, oflag, mode), fd); in handleOpen()
69 if (fd != -1) { in handleOpen()
72 RESTARTABLE(fstat64(fd, &buf64), result); in handleOpen()
75 close(fd); in handleOpen()
77 fd = -1; in handleOpen()
80 close(fd); in handleOpen()
81 fd = -1; in handleOpen()
84 return fd; in handleOpen()
92 FD fd; in fileOpen() local
[all …]
DFileDispatcherImpl.c67 jint fd = fdval(env, fdo); in FileDispatcherImpl_read0() local
70 return convertReturnVal(env, read(fd, buf, len), JNI_TRUE); in FileDispatcherImpl_read0()
77 jint fd = fdval(env, fdo); in FileDispatcherImpl_pread0() local
80 return convertReturnVal(env, pread64(fd, buf, len, offset), JNI_TRUE); in FileDispatcherImpl_pread0()
87 jint fd = fdval(env, fdo); in FileDispatcherImpl_readv0() local
89 return convertLongReturnVal(env, readv(fd, iov, len), JNI_TRUE); in FileDispatcherImpl_readv0()
96 jint fd = fdval(env, fdo); in FileDispatcherImpl_write0() local
99 return convertReturnVal(env, write(fd, buf, len), JNI_FALSE); in FileDispatcherImpl_write0()
106 jint fd = fdval(env, fdo); in FileDispatcherImpl_pwrite0() local
109 return convertReturnVal(env, pwrite64(fd, buf, len, offset), JNI_FALSE); in FileDispatcherImpl_pwrite0()
[all …]
DFileSystemPreferences.c70 int fd, rc; in Java_java_util_prefs_FileSystemPreferences_lockFile0() local
86 fd = open(fname, O_RDONLY, 0); in Java_java_util_prefs_FileSystemPreferences_lockFile0()
89 fd = open(fname, O_WRONLY|O_CREAT, permission); in Java_java_util_prefs_FileSystemPreferences_lockFile0()
94 if (fd < 0) { in Java_java_util_prefs_FileSystemPreferences_lockFile0()
98 rc = fcntl(fd, F_SETLK, &fl); in Java_java_util_prefs_FileSystemPreferences_lockFile0()
100 rc = fcntl(fd, F_SETLK64, &fl); in Java_java_util_prefs_FileSystemPreferences_lockFile0()
105 close(fd); in Java_java_util_prefs_FileSystemPreferences_lockFile0()
107 result[0] = fd; in Java_java_util_prefs_FileSystemPreferences_lockFile0()
122 jclass thisclass, jint fd) { in Java_java_util_prefs_FileSystemPreferences_unlockFile0() argument
132 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.java74 PlainSocketImpl(FileDescriptor fd) { in PlainSocketImpl() argument
75 this.fd = fd; in PlainSocketImpl()
116 fd.setInt$(IoBridge.socket(AF_INET6, isStream ? SOCK_STREAM : SOCK_DGRAM, 0).getInt$()); in socketCreate()
119 IoUtils.setBlocking(fd, false); in socketCreate()
120 IoBridge.setSocketOption(fd, SO_REUSEADDR, true); in socketCreate()
125 if (fd == null || !fd.valid()) { in socketConnect()
129 IoBridge.connect(fd, address, port, timeout); in socketConnect()
139 localport = IoBridge.getLocalInetSocketAddress(fd).getPort(); in socketConnect()
145 if (fd == null || !fd.valid()) { in socketBind()
149 IoBridge.bind(fd, address, port); in socketBind()
[all …]
DAbstractPlainSocketImpl.java106 if (fd != null && fd.valid()) { in create()
349 NetHooks.beforeTcpConnect(fd, address, port); in doConnect()
390 NetHooks.beforeTcpBind(fd, address, lport); in bind()
456 void setFileDescriptor(FileDescriptor fd) { in setFileDescriptor() argument
457 this.fd = fd; in setFileDescriptor()
519 if (fd != null && fd.valid()) { in close()
531 SocketTagger.get().untag(fd); in close()
568 if (fd != null && fd.valid()) { in reset()
581 if (fd != null && fd.valid()) { in shutdownInput()
594 if (fd != null && fd.valid()) { in shutdownOutput()
[all …]
DPlainDatagramSocketImpl.java103 IoBridge.bind(fd, laddr, lport); in bind0()
108 localPort = IoBridge.getLocalInetSocketAddress(fd).getPort(); in bind0()
124 IoBridge.sendto(fd, p.getData(), p.getOffset(), p.getLength(), 0, address, port); in send()
149 IoBridge.poll(fd, POLLIN | POLLERR, timeout); in doRecv()
152 IoBridge.recvfrom(false, fd, p.getData(), p.getOffset(), p.bufLength, flags, p, in doRecv()
157 IoBridge.setSocketOption(fd, JAVA_IP_MULTICAST_TTL, ttl); in setTimeToLive()
161 return (Integer) IoBridge.getSocketOption(fd, JAVA_IP_MULTICAST_TTL); in getTimeToLive()
183 IoBridge.setSocketOption(fd, JAVA_MCAST_JOIN_GROUP, makeGroupReq(inetaddr, netIf)); in join()
192 IoBridge.setSocketOption(fd, JAVA_MCAST_LEAVE_GROUP, makeGroupReq(inetaddr, netIf)); in leave()
196 fd = IoBridge.socket(AF_INET6, SOCK_DGRAM, 0); in datagramSocketCreate()
[all …]
/libcore/luni/src/test/java/libcore/java/util/zip/
DZipFileTest.java48 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()
/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()

12345