Searched refs:fd (Results 1 - 25 of 71) sorted by relevance

123

/dalvik/libcore/include/
H A DScopedFd.h22 // A smart pointer that closes the given fd on going out of scope.
23 // Use this when the fd is incidental to the purpose of your function,
27 explicit ScopedFd(int fd) : fd(fd) { argument
31 close(fd);
35 return fd;
39 int fd; member in class:ScopedFd
/dalvik/libcore/luni/src/main/java/org/apache/harmony/luni/net/
H A DPlainServerSocketImpl.java36 public PlainServerSocketImpl(FileDescriptor fd) { argument
38 this.fd = fd;
45 netImpl.createServerStreamSocket(fd, NetUtil.preferIPv4Stack());
47 netImpl.createDatagramSocket(fd, NetUtil.preferIPv4Stack());
H A DPlainSocketImpl.java89 fd = new FileDescriptor();
92 public PlainSocketImpl(FileDescriptor fd) { argument
94 this.fd = fd;
105 public PlainSocketImpl(FileDescriptor fd, int localport, InetAddress addr, int port) { argument
107 this.fd = fd;
126 netImpl.accept(fd, newImpl, newPlainSocketImpl
134 fdField = getSocketImplField("fd"); //$NON-NLS-1$
139 netImpl.accept(fd, newImp
[all...]
H A DPlainDatagramSocketImpl.java105 public PlainDatagramSocketImpl(FileDescriptor fd, int localPort) { argument
107 this.fd = fd;
113 fd = new FileDescriptor();
120 netImpl.bind(fd, addr, port);
124 localPort = netImpl.getSocketLocalPort(fd);
136 synchronized (fd) {
137 if (fd.valid()) {
139 netImpl.socketClose(fd);
142 fd
[all...]
/dalvik/libcore/luni/src/main/java/java/io/
H A DFileOutputStream.java45 FileDescriptor fd; field in class:FileOutputStream
96 fd = new FileDescriptor();
97 fd.descriptor = fileSystem.open(file.pathBytes,
100 channel = FileChannelFactory.getFileChannel(this, fd.descriptor,
105 * Constructs a new FileOutputStream on the FileDescriptor {@code fd}. The
109 * @param fd
112 * if {@code fd} is {@code null}.
118 public FileOutputStream(FileDescriptor fd) { argument
120 if (fd == null) {
125 security.checkWrite(fd);
[all...]
H A DFileReader.java46 * Construct a new FileReader on the given FileDescriptor {@code fd}. Since
50 * @param fd
53 public FileReader(FileDescriptor fd) { argument
54 super(new FileInputStream(fd));
H A DFileInputStream.java42 FileDescriptor fd; field in class:FileInputStream
80 fd = new FileDescriptor();
81 fd.readOnly = true;
82 fd.descriptor = fileSystem.open(file.pathBytes, IFileSystem.O_RDONLY);
85 // channel = FileChannelFactory.getFileChannel(this, fd.descriptor,
92 * {@code fd}. The file must already be open, therefore no
95 * @param fd
98 * if {@code fd} is {@code null}.
103 public FileInputStream(FileDescriptor fd) { argument
105 if (fd
[all...]
H A DFileWriter.java62 * Creates a FileWriter using the existing FileDescriptor {@code fd}.
64 * @param fd
67 public FileWriter(FileDescriptor fd) { argument
68 super(new FileOutputStream(fd));
H A DRandomAccessFile.java41 private FileDescriptor fd; field in class:RandomAccessFile
116 fd = new FileDescriptor();
120 fd.readOnly = true;
145 fd.descriptor = fileSystem.open(file.pathBytes, options);
147 // channel = FileChannelFactory.getFileChannel(this, fd.descriptor,
154 fd.sync();
202 if (fd != null && fd.descriptor >= 0) {
203 fileSystem.close(fd.descriptor);
204 fd
[all...]
/dalvik/libcore/luni/src/main/java/org/apache/harmony/luni/platform/
H A DOSNetworkSystem.java88 public int availableStream(FileDescriptor fd) throws SocketException { argument
89 return availableStreamImpl(fd);
97 * @param fd
106 public void bind(FileDescriptor fd, InetAddress inetAddress, int port) throws SocketException { argument
107 socketBindImpl(fd, port, inetAddress);
113 public void connect(FileDescriptor fd, int trafficClass, argument
115 connectStreamWithTimeoutSocketImpl(fd, port, 0, trafficClass, inetAddress);
119 public void connectDatagram(FileDescriptor fd, int port, argument
121 connectDatagramImpl2(fd, port, trafficClass, inetAddress);
140 public int connectWithTimeout(FileDescriptor fd, in argument
152 createDatagramSocket(FileDescriptor fd, boolean preferIPv4Stack) argument
168 createServerStreamSocket(FileDescriptor fd, boolean preferIPv4Stack) argument
184 createStreamSocket(FileDescriptor fd, boolean preferIPv4Stack) argument
201 disconnectDatagram(FileDescriptor fd) argument
245 getSocketLocalAddress(FileDescriptor fd) argument
266 getSocketOption(FileDescriptor fd, int opt) argument
315 peekDatagram(FileDescriptor fd, InetAddress sender, int receiveTimeout) argument
350 read(FileDescriptor fd, byte[] data, int offset, int count, int timeout) argument
382 readDirect(FileDescriptor fd, int address, int count, int timeout) argument
413 receiveDatagram(FileDescriptor fd, DatagramPacket packet, byte[] data, int offset, int length, int receiveTimeout, boolean peek) argument
424 receiveDatagramDirect(FileDescriptor fd, DatagramPacket packet, int address, int offset, int length, int receiveTimeout, boolean peek) argument
458 recvConnectedDatagram(FileDescriptor fd, DatagramPacket packet, byte[] data, int offset, int length, int receiveTimeout, boolean peek) argument
524 sendConnectedDatagram(FileDescriptor fd, byte[] data, int offset, int length, boolean bindToDevice) argument
529 sendConnectedDatagramImpl(FileDescriptor fd, byte[] data, int offset, int length, boolean bindToDevice) argument
533 sendConnectedDatagramDirect(FileDescriptor fd, int address, int offset, int length, boolean bindToDevice) argument
538 sendConnectedDatagramDirectImpl(FileDescriptor fd, int address, int offset, int length, boolean bindToDevice) argument
568 sendDatagram(FileDescriptor fd, byte[] data, int offset, int length, int port, boolean bindToDevice, int trafficClass, InetAddress inetAddress) argument
575 sendDatagramImpl(FileDescriptor fd, byte[] data, int offset, int length, int port, boolean bindToDevice, int trafficClass, InetAddress inetAddress) argument
579 sendDatagram2(FileDescriptor fd, byte[] data, int offset, int length, int port, InetAddress inetAddress) argument
584 sendDatagramImpl2(FileDescriptor fd, byte[] data, int offset, int length, int port, InetAddress inetAddress) argument
588 sendDatagramDirect(FileDescriptor fd, int address, int offset, int length, int port, boolean bindToDevice, int trafficClass, InetAddress inetAddress) argument
595 sendDatagramDirectImpl(FileDescriptor fd, int address, int offset, int length, int port, boolean bindToDevice, int trafficClass, InetAddress inetAddress) argument
599 sendUrgentData(FileDescriptor fd, byte value) argument
603 sendUrgentDataImpl(FileDescriptor fd, byte value) argument
611 setNonBlocking(FileDescriptor fd, boolean block) argument
643 shutdownOutput(FileDescriptor fd) argument
655 socketClose(FileDescriptor fd) argument
661 supportsUrgentData(FileDescriptor fd) argument
665 supportsUrgentDataImpl(FileDescriptor fd) argument
721 write(FileDescriptor fd, byte[] data, int offset, int count) argument
726 writeSocketImpl(FileDescriptor fd, byte[] data, int offset, int count) argument
744 writeDirect(FileDescriptor fd, int address, int offset, int count) argument
749 writeSocketDirectImpl(FileDescriptor fd, int address, int offset, int count) argument
[all...]
H A DINetworkSystem.java63 public int write(FileDescriptor fd, byte[] data, int offset, int count) argument
68 public int writeDirect(FileDescriptor fd, int address, int offset, int count) argument
73 // public int writev(FileDescriptor fd, Object[] buffers, int[] offsets,
91 public int sendDatagram(FileDescriptor fd, byte[] data, int offset, argument
95 public int sendDatagramDirect(FileDescriptor fd, int address, int offset, argument
118 public int sendConnectedDatagram(FileDescriptor fd, byte[] data, argument
121 public int sendConnectedDatagramDirect(FileDescriptor fd, int address, argument
141 public boolean supportsUrgentData(FileDescriptor fd); argument
143 public void sendUrgentData(FileDescriptor fd, byte value); argument
166 public int sendDatagram2(FileDescriptor fd, byt argument
[all...]
/dalvik/libcore/nio/src/main/java/org/apache/harmony/nio/
H A DFileChannelFactory.java38 public static FileChannel getFileChannel(Object stream, int fd, int mode) { argument
41 return new ReadOnlyFileChannel(stream, fd);
43 return new WriteOnlyFileChannel(stream, fd);
45 return new ReadWriteFileChannel(stream, fd);
47 return new ReadWriteFileChannel(stream, fd);
49 return new WriteOnlyFileChannel(stream, fd, true);
/dalvik/libdex/
H A DSysUtil.h61 int sysLoadFileInShmem(int fd, MemMapping* pMap);
64 * Map a file (from fd's current offset) into a shared,
69 int sysMapFileInShmemReadOnly(int fd, MemMapping* pMap);
72 * Map a file (from fd's current offset) into a shared, read-only memory
78 int sysMapFileInShmemWritableReadOnly(int fd, MemMapping* pMap);
83 int sysMapFileSegmentInShmem(int fd, off_t start, long length,
H A DCmdUtils.c42 int fd = -1; local
53 fd = open(outFileName, O_WRONLY | O_CREAT | O_EXCL, 0600);
54 if (fd < 0) {
73 if (!dexZipExtractEntryToFile(&archive, entry, fd)) {
81 if (fd >= 0)
82 close(fd);
109 int fd = -1; local
156 fd = open(fileName, O_RDONLY);
157 if (fd < 0) {
165 if (sysMapFileInShmemReadOnly(fd, pMa
[all...]
H A DOptInvocation.h35 int dexOptCreateEmptyHeader(int fd);
H A DSysUtil.c87 static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) argument
95 start = lseek(fd, 0L, SEEK_CUR);
96 end = lseek(fd, 0L, SEEK_END);
97 (void) lseek(fd, start, SEEK_SET);
118 * everything from fd's current offset on.
123 int sysLoadFileInShmem(int fd, MemMapping* pMap) argument
132 if (getFileStartAndLength(fd, &start, &length) < 0)
139 actual = read(fd, memPtr, length);
157 int sysFakeMapFile(int fd, MemMapping* pMap) argument
169 if (getFileStartAndLength(fd,
193 sysMapFileInShmemReadOnly(int fd, MemMapping* pMap) argument
232 sysMapFileInShmemWritableReadOnly(int fd, MemMapping* pMap) argument
275 sysMapFileSegmentInShmem(int fd, off_t start, long length, MemMapping* pMap) argument
[all...]
/dalvik/dx/tests/083-ssa-phi-placement/
H A DBlort.java48 Object fd; field in class:Blort
51 if (fd == null) {
/dalvik/vm/
H A DJarFile.c50 int fd = -1; local
69 fd = open(buf, flags);
70 if (fd >= 0) {
72 return fd;
88 int fd; local
122 fd = dvmOpenCachedDexFile(fileName, cachedName,
126 LOGV("dvmOpenCachedDexFile returned fd %d\n", fd);
127 if (fd < 0) {
135 if (!dvmUnlockCachedDexFile(fd)) {
194 int fd = -1; local
[all...]
H A DSignalCatcher.c77 int fd = -1; local
79 fd = open("/proc/self/cmdline", O_RDONLY, 0);
80 if (fd < 0)
86 actual = read(fd, tmpBuf, sizeof(tmpBuf)-1);
94 if (fd >= 0)
95 close(fd);
192 int fd = open(gDvm.stackTraceFile, O_WRONLY | O_APPEND | O_CREAT, 0666); local
193 if (fd < 0) {
197 ssize_t actual = write(fd, traceBuf, traceLen);
205 close(fd);
[all...]
/dalvik/libcore/luni/src/test/java/tests/api/java/io/
H A DFileDescriptorTest.java55 FileDescriptor fd = new FileDescriptor();
57 fd instanceof FileDescriptor);
72 f = File.createTempFile("fd" + platformId, ".tst");
77 FileDescriptor fd = fos.getFD();
78 fd.sync();
84 fd = fis.getFD();
85 fd.sync();
90 fd = raf.getFD();
91 fd.sync();
106 f = new File(System.getProperty("java.io.tmpdir"), "fd
[all...]
/dalvik/libcore/security/src/test/java/tests/security/permissions/
H A DJavaIoFileInputStreamTest.java77 FileDescriptor fd;
81 fd = null;
84 public void checkRead(FileDescriptor fd) {
86 this.fd = fd;
87 super.checkRead(fd);
111 FileDescriptor fd = new FileDescriptor();
112 new FileInputStream(fd);
114 assertEquals("Argument of checkRead is not correct", fd, s.fd);
[all...]
H A DJavaIoFileOutputStreamTest.java89 FileDescriptor fd;
93 fd = null;
96 public void checkWrite(FileDescriptor fd) {
98 this.fd = fd;
99 super.checkWrite(fd);
123 FileDescriptor fd = new FileDescriptor();
124 new FileOutputStream(fd);
126 assertEquals("Argument of checkWrite is not correct", fd, s.fd);
[all...]
/dalvik/libcore/luni-kernel/src/main/java/java/lang/
H A DProcessManager.java356 /** Automatically closes fd when collected. */
359 private FileDescriptor fd; field in class:ProcessManager.ProcessInputStream
361 private ProcessInputStream(FileDescriptor fd) { argument
362 super(fd);
363 this.fd = fd;
372 if (fd != null && fd.valid()) {
374 ProcessManager.close(fd);
376 fd
387 private FileDescriptor fd; field in class:ProcessManager.ProcessOutputStream
389 ProcessOutputStream(FileDescriptor fd) argument
413 close(FileDescriptor fd) argument
[all...]
/dalvik/libcore/luni/src/main/native/
H A Difaddrs-android.h74 ScopedFd fd(socket(AF_INET, SOCK_DGRAM, 0));
75 if (fd.get() == -1) {
81 int rc = ioctl(fd.get(), SIOCGIFFLAGS, &ifr);
113 inline bool sendNetlinkMessage(int fd, const void* data, size_t byteCount) { argument
114 ssize_t sentByteCount = TEMP_FAILURE_RETRY(send(fd, data, byteCount, 0));
118 inline ssize_t recvNetlinkMessage(int fd, char* buf, size_t byteCount) { argument
119 return TEMP_FAILURE_RETRY(recv(fd, buf, byteCount, 0));
128 ScopedFd fd(socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE));
129 if (fd.get() < 0) {
141 if (!sendNetlinkMessage(fd
[all...]
/dalvik/vm/analysis/
H A DDexOptimize.h91 bool dvmUnlockCachedDexFile(int fd);
97 bool dvmCheckOptHeaderAndDependencies(int fd, bool sourceAvail, u4 modWhen,
106 bool dvmOptimizeDexFile(int fd, off_t dexOffset, long dexLen,
112 bool dvmContinueOptimization(int fd, off_t dexOffset, long dexLength,

Completed in 418 milliseconds

123