/frameworks/base/core/java/android/net/ |
D | LocalSocketImpl.java | 41 private FileDescriptor fd; field in LocalSocketImpl 59 FileDescriptor myFd = fd; in available() 76 FileDescriptor myFd = fd; in read() 94 FileDescriptor myFd = fd; in read() 129 FileDescriptor myFd = fd; in write() 143 FileDescriptor myFd = fd; in write() 157 FileDescriptor myFd = fd; in flush() 169 private native int pending_native(FileDescriptor fd) throws IOException; in pending_native() argument 170 private native int available_native(FileDescriptor fd) throws IOException; in available_native() argument 171 private native int read_native(FileDescriptor fd) throws IOException; in read_native() argument [all …]
|
/frameworks/base/libs/androidfw/ |
D | ObbFile.cpp | 88 int fd; in readFrom() local 91 fd = ::open(filename, O_RDONLY); in readFrom() 92 if (fd < 0) { in readFrom() 96 success = readFrom(fd); in readFrom() 97 close(fd); in readFrom() 100 ALOGW("failed to read from %s (fd=%d)\n", filename, fd); in readFrom() 107 bool ObbFile::readFrom(int fd) in readFrom() argument 109 if (fd < 0) { in readFrom() 114 return parseObbFile(fd); in readFrom() 117 bool ObbFile::parseObbFile(int fd) in parseObbFile() argument [all …]
|
D | BackupHelpers.cpp | 90 read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot) in read_snapshot_file() argument 96 amt = read(fd, &header, sizeof(header)); in read_snapshot_file() 111 amt = read(fd, &file, sizeof(FileState)); in read_snapshot_file() 123 amt = read(fd, filename, nameBufSize); in read_snapshot_file() 147 write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot) in write_snapshot_file() argument 162 LOGP("write_snapshot_file fd=%d\n", fd); in write_snapshot_file() 167 amt = write(fd, &header, sizeof(header)); in write_snapshot_file() 179 amt = write(fd, &r.s, sizeof(FileState)); in write_snapshot_file() 186 amt = write(fd, name.string(), nameLen); in write_snapshot_file() 194 amt = write(fd, &padding, paddingLen); in write_snapshot_file() [all …]
|
D | Asset.cpp | 126 int fd; in createFromFile() local 128 fd = open(fileName, O_RDONLY | O_BINARY); in createFromFile() 129 if (fd < 0) in createFromFile() 140 length = lseek64(fd, 0, SEEK_END); in createFromFile() 142 ::close(fd); in createFromFile() 145 (void) lseek64(fd, 0, SEEK_SET); in createFromFile() 148 if (fstat(fd, &st) < 0) { in createFromFile() 149 ::close(fd); in createFromFile() 154 ::close(fd); in createFromFile() 160 result = pAsset->openChunk(fileName, fd, 0, length); in createFromFile() [all …]
|
/frameworks/base/services/core/jni/ |
D | com_android_server_UsbDeviceManager.cpp | 52 static void set_accessory_string(JNIEnv *env, int fd, int cmd, jobjectArray strArray, int index) in set_accessory_string() argument 57 int length = ioctl(fd, cmd, buffer); in set_accessory_string() 68 int fd = open(DRIVER_NAME, O_RDWR); in android_server_UsbDeviceManager_getAccessoryStrings() local 69 if (fd < 0) { in android_server_UsbDeviceManager_getAccessoryStrings() 76 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MANUFACTURER, strArray, 0); in android_server_UsbDeviceManager_getAccessoryStrings() 77 set_accessory_string(env, fd, ACCESSORY_GET_STRING_MODEL, strArray, 1); in android_server_UsbDeviceManager_getAccessoryStrings() 78 set_accessory_string(env, fd, ACCESSORY_GET_STRING_DESCRIPTION, strArray, 2); in android_server_UsbDeviceManager_getAccessoryStrings() 79 set_accessory_string(env, fd, ACCESSORY_GET_STRING_VERSION, strArray, 3); in android_server_UsbDeviceManager_getAccessoryStrings() 80 set_accessory_string(env, fd, ACCESSORY_GET_STRING_URI, strArray, 4); in android_server_UsbDeviceManager_getAccessoryStrings() 81 set_accessory_string(env, fd, ACCESSORY_GET_STRING_SERIAL, strArray, 5); in android_server_UsbDeviceManager_getAccessoryStrings() [all …]
|
D | com_android_server_PersistentDataBlockService.cpp | 34 uint64_t get_block_device_size(int fd) in get_block_device_size() argument 39 ret = ioctl(fd, BLKGETSIZE64, &size); in get_block_device_size() 47 int wipe_block_device(int fd) in wipe_block_device() argument 51 uint64_t len = get_block_device_size(fd); in wipe_block_device() 59 ret = ioctl(fd, BLKSECDISCARD, &range); in wipe_block_device() 64 ret = ioctl(fd, BLKDISCARD, &range); in wipe_block_device() 81 int fd = open(path, O_RDONLY); in com_android_server_PersistentDataBlockService_getBlockDeviceSize() local 83 if (fd < 0) in com_android_server_PersistentDataBlockService_getBlockDeviceSize() 86 return get_block_device_size(fd); in com_android_server_PersistentDataBlockService_getBlockDeviceSize() 91 int fd = open(path, O_WRONLY); in com_android_server_PersistentDataBlockService_wipe() local [all …]
|
/frameworks/native/libs/binder/ |
D | MemoryHeapBase.cpp | 50 int fd = ashmem_create_region(name == NULL ? "MemoryHeapBase" : name, size); in MemoryHeapBase() local 51 ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); in MemoryHeapBase() 52 if (fd >= 0) { in MemoryHeapBase() 53 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase() 55 ashmem_set_prot_region(fd, PROT_READ); in MemoryHeapBase() 69 int fd = open(device, open_flags); in MemoryHeapBase() local 70 ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); in MemoryHeapBase() 71 if (fd >= 0) { in MemoryHeapBase() 74 if (mapfd(fd, size) == NO_ERROR) { in MemoryHeapBase() 80 MemoryHeapBase::MemoryHeapBase(int fd, size_t size, uint32_t flags, uint32_t offset) in MemoryHeapBase() argument [all …]
|
/frameworks/base/core/jni/ |
D | android_net_LocalSocketImpl.cpp | 56 int fd; in socket_connect_local() local 58 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_connect_local() 67 fd, in socket_connect_local() 89 int fd; in socket_bind_local() local 96 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_bind_local() 104 ret = socket_local_server_bind(fd, nameUtf8.c_str(), namespaceId); in socket_bind_local() 117 int fd; in socket_listen() local 119 fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in socket_listen() 125 ret = listen(fd, backlog); in socket_listen() 147 int fd; in socket_accept() local [all …]
|
D | android_os_MemoryFile.cpp | 49 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_mmap() local 50 void* result = mmap(NULL, length, prot, MAP_SHARED, fd, 0); in android_os_MemoryFile_mmap() 66 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_close() local 67 if (fd >= 0) { in android_os_MemoryFile_close() 69 close(fd); in android_os_MemoryFile_close() 77 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_read() local 78 if (unpinned && ashmem_pin_region(fd, 0, 0) == ASHMEM_WAS_PURGED) { in android_os_MemoryFile_read() 79 ashmem_unpin_region(fd, 0, 0); in android_os_MemoryFile_read() 87 ashmem_unpin_region(fd, 0, 0); in android_os_MemoryFile_read() 96 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_os_MemoryFile_write() local [all …]
|
D | com_android_internal_os_ZygoteInit.cpp | 94 int fd; in com_android_internal_os_ZygoteInit_reopenStdio() local 97 fd = jniGetFDFromFileDescriptor(env, in); in com_android_internal_os_ZygoteInit_reopenStdio() 104 err = dup2(fd, STDIN_FILENO); in com_android_internal_os_ZygoteInit_reopenStdio() 107 fd = jniGetFDFromFileDescriptor(env, out); in com_android_internal_os_ZygoteInit_reopenStdio() 114 err = dup2(fd, STDOUT_FILENO); in com_android_internal_os_ZygoteInit_reopenStdio() 117 fd = jniGetFDFromFileDescriptor(env, errfd); in com_android_internal_os_ZygoteInit_reopenStdio() 124 err = dup2(fd, STDERR_FILENO); in com_android_internal_os_ZygoteInit_reopenStdio() 131 int fd; in com_android_internal_os_ZygoteInit_setCloseOnExec() local 135 fd = jniGetFDFromFileDescriptor(env, descriptor); in com_android_internal_os_ZygoteInit_setCloseOnExec() 141 fdFlags = fcntl(fd, F_GETFD); in com_android_internal_os_ZygoteInit_setCloseOnExec() [all …]
|
D | android_hardware_SerialPort.cpp | 135 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor); in android_hardware_SerialPort_open() local 137 fd = dup(fd); in android_hardware_SerialPort_open() 138 if (fd < 0) { in android_hardware_SerialPort_open() 142 env->SetIntField(thiz, field_context, fd); in android_hardware_SerialPort_open() 145 if (tcgetattr(fd, &tio)) in android_hardware_SerialPort_open() 156 tcsetattr(fd, TCSANOW, &tio); in android_hardware_SerialPort_open() 157 tcflush(fd, TCIFLUSH); in android_hardware_SerialPort_open() 163 int fd = env->GetIntField(thiz, field_context); in android_hardware_SerialPort_close() local 164 close(fd); in android_hardware_SerialPort_close() 171 int fd = env->GetIntField(thiz, field_context); in android_hardware_SerialPort_read_array() local [all …]
|
D | android_backup_BackupHelperDispatcher.cpp | 51 int fd = jniGetFDFromFileDescriptor(env, fdObj); in readHeader_native() local 53 amt = read(fd, &flattenedHeader.headerSize, sizeof(flattenedHeader.headerSize)); in readHeader_native() 63 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native() 69 amt = read(fd, &flattenedHeader.version, in readHeader_native() 81 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native() 108 amt = read(fd, buf, flattenedHeader.nameLength); in readHeader_native() 116 lseek(fd, remainingHeader, SEEK_CUR); in readHeader_native() 128 int fd = jniGetFDFromFileDescriptor(env, fdObj); in skipChunk_native() local 130 lseek(fd, bytesToSkip, SEEK_CUR); in skipChunk_native() 151 int fd = jniGetFDFromFileDescriptor(env, fdObj); in allocateHeader_native() local [all …]
|
/frameworks/base/cmds/idmap/ |
D | create.cpp | 34 int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)); in open_idmap() local 35 if (fd == -1) { in open_idmap() 39 if (fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0) { in open_idmap() 43 if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) { in open_idmap() 48 return fd; in open_idmap() 50 if (fd != -1) { in open_idmap() 51 close(fd); in open_idmap() 57 int write_idmap(int fd, const uint32_t *data, size_t size) in write_idmap() argument 59 if (lseek(fd, SEEK_SET, 0) < 0) { in write_idmap() 64 ssize_t w = TEMP_FAILURE_RETRY(write(fd, data + size - bytesLeft, bytesLeft)); in write_idmap() [all …]
|
/frameworks/base/libs/androidfw/tests/ |
D | BackupData_test.cpp | 60 int fd = ::open(mFilename.string(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); in SetUp() local 61 if (fd < 0) { in SetUp() 75 int fd = ::open(mFilename.string(), O_WRONLY); in TEST_F() local 76 BackupDataWriter* writer = new BackupDataWriter(fd); in TEST_F() 83 ::close(fd); in TEST_F() 84 fd = ::open(mFilename.string(), O_RDONLY); in TEST_F() 85 BackupDataReader* reader = new BackupDataReader(fd); in TEST_F() 117 int fd = ::open(mFilename.string(), O_WRONLY); in TEST_F() local 118 BackupDataWriter* writer = new BackupDataWriter(fd); in TEST_F() 124 ::close(fd); in TEST_F() [all …]
|
/frameworks/native/cmds/dumpstate/ |
D | utils.c | 91 int fd; in __for_each_pid() local 101 if ((fd = open(cmdpath, O_RDONLY)) < 0) { in __for_each_pid() 104 read(fd, cmdline, sizeof(cmdline) - 1); in __for_each_pid() 105 close(fd); in __for_each_pid() 139 int fd; in for_each_tid_helper() local 152 if ((fd = open(commpath, O_RDONLY)) < 0) { in for_each_tid_helper() 156 read(fd, comm, sizeof(comm) - 1); in for_each_tid_helper() 157 close(fd); in for_each_tid_helper() 177 int fd; in show_wchan() local 183 if ((fd = open(path, O_RDONLY)) < 0) { in show_wchan() [all …]
|
/frameworks/base/core/java/com/android/server/ |
D | NetworkManagementSocketTagger.java | 66 public void tag(FileDescriptor fd) throws SocketException { in tag() argument 69 Log.d(TAG, "tagSocket(" + fd.getInt$() + ") with statsTag=0x" in tag() 73 tagSocketFd(fd, options.statsTag, options.statsUid); in tag() 76 private void tagSocketFd(FileDescriptor fd, int tag, int uid) { in tagSocketFd() argument 80 final int errno = native_tagSocketFd(fd, tag, uid); in tagSocketFd() 82 Log.i(TAG, "tagSocketFd(" + fd.getInt$() + ", " in tagSocketFd() 90 public void untag(FileDescriptor fd) throws SocketException { in untag() argument 92 Log.i(TAG, "untagSocket(" + fd.getInt$() + ")"); in untag() 94 unTagSocketFd(fd); in untag() 97 private void unTagSocketFd(FileDescriptor fd) { in unTagSocketFd() argument [all …]
|
/frameworks/rs/driver/ |
D | rsdShader.cpp | 309 void RsdShader::logUniform(const Element *field, const float *fd, uint32_t arraySize ) { in logUniform() argument 318 ALOGV("{%f, %f, %f, %f", fd[0], fd[4], fd[8], fd[12]); in logUniform() 319 ALOGV(" %f, %f, %f, %f", fd[1], fd[5], fd[9], fd[13]); in logUniform() 320 ALOGV(" %f, %f, %f, %f", fd[2], fd[6], fd[10], fd[14]); in logUniform() 321 ALOGV(" %f, %f, %f, %f}", fd[3], fd[7], fd[11], fd[15]); in logUniform() 324 ALOGV("{%f, %f, %f", fd[0], fd[3], fd[6]); in logUniform() 325 ALOGV(" %f, %f, %f", fd[1], fd[4], fd[7]); in logUniform() 326 ALOGV(" %f, %f, %f}", fd[2], fd[5], fd[8]); in logUniform() 329 ALOGV("{%f, %f", fd[0], fd[2]); in logUniform() 330 ALOGV(" %f, %f}", fd[1], fd[3]); in logUniform() [all …]
|
/frameworks/av/drm/common/ |
D | ReadWriteUtils.cpp | 41 int fd = fileno(file); in readBytes() local 44 if (fstat(fd, &sb) == 0 && sb.st_size > 0) { in readBytes() 47 if (length == read(fd, (void*) bytes, length)) { in readBytes() 63 int fd = fileno(file); in readBytes() local 66 if (fstat(fd, &sb) == 0 && sb.st_size > 0) { in readBytes() 69 if (length != read(fd, (void*) *buffer, length)) { in readBytes() 83 int fd = fileno(file); in writeToFile() local 86 if (FAILURE != ftruncate(fd, size)) { in writeToFile() 87 if (size != write(fd, data.string(), size)) { in writeToFile() 100 int fd = fileno(file); in appendToFile() local [all …]
|
/frameworks/native/opengl/libs/EGL/ |
D | egl_cache.cpp | 225 int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); in saveBlobCacheLocked() local 226 if (fd == -1) { in saveBlobCacheLocked() 236 fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); in saveBlobCacheLocked() 238 if (fd == -1) { in saveBlobCacheLocked() 251 close(fd); in saveBlobCacheLocked() 261 close(fd); in saveBlobCacheLocked() 271 if (write(fd, buf, fileSize) == -1) { in saveBlobCacheLocked() 275 close(fd); in saveBlobCacheLocked() 281 fchmod(fd, S_IRUSR); in saveBlobCacheLocked() 282 close(fd); in saveBlobCacheLocked() [all …]
|
/frameworks/base/media/java/android/media/ |
D | MediaMetadataRetriever.java | 70 FileDescriptor fd = is.getFD(); in setDataSource() local 71 setDataSource(fd, 0, 0x7ffffffffffffffL); in setDataSource() 129 public native void setDataSource(FileDescriptor fd, long offset, long length) in setDataSource() argument 141 public void setDataSource(FileDescriptor fd) in setDataSource() argument 144 setDataSource(fd, 0, 0x7ffffffffffffffL); in setDataSource() 169 AssetFileDescriptor fd = null; in setDataSource() local 173 fd = resolver.openAssetFileDescriptor(uri, "r"); in setDataSource() 177 if (fd == null) { in setDataSource() 180 FileDescriptor descriptor = fd.getFileDescriptor(); in setDataSource() 187 if (fd.getDeclaredLength() < 0) { in setDataSource() [all …]
|
D | MediaExtractor.java | 90 AssetFileDescriptor fd = null; in setDataSource() local 93 fd = resolver.openAssetFileDescriptor(uri, "r"); in setDataSource() 94 if (fd == null) { in setDataSource() 100 if (fd.getDeclaredLength() < 0) { in setDataSource() 101 setDataSource(fd.getFileDescriptor()); in setDataSource() 104 fd.getFileDescriptor(), in setDataSource() 105 fd.getStartOffset(), in setDataSource() 106 fd.getDeclaredLength()); in setDataSource() 112 if (fd != null) { in setDataSource() 113 fd.close(); in setDataSource() [all …]
|
/frameworks/base/libs/usb/tests/accessorytest/ |
D | hid.c | 50 int fd = (int)arg; in hid_thread() local 59 fprintf(stderr, "hid_thread start fd: %d\n", fd); in hid_thread() 61 if (ioctl(fd, HIDIOCGRDESCSIZE, &desc_length)) { in hid_thread() 63 close(fd); in hid_thread() 68 if (ioctl(fd, HIDIOCGRDESC, &desc)) { in hid_thread() 70 close(fd); in hid_thread() 75 fprintf(stderr, "waiting for device fd: %d\n", fd); in hid_thread() 109 ret = read(fd, buffer, sizeof(buffer)); in hid_thread() 111 fprintf(stderr, "read failed, errno: %d, fd: %d\n", errno, fd); in hid_thread() 137 int fd = open(path, O_RDWR); in open_hid() local [all …]
|
/frameworks/base/core/java/android/content/res/ |
D | AssetFileDescriptor.java | 57 public AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset, in AssetFileDescriptor() argument 59 this(fd, startOffset, length, null); in AssetFileDescriptor() 73 public AssetFileDescriptor(ParcelFileDescriptor fd, long startOffset, in AssetFileDescriptor() argument 75 if (fd == null) { in AssetFileDescriptor() 82 mFd = fd; in AssetFileDescriptor() 204 public AutoCloseInputStream(AssetFileDescriptor fd) throws IOException { in AutoCloseInputStream() argument 205 super(fd.getParcelFileDescriptor()); in AutoCloseInputStream() 206 super.skip(fd.getStartOffset()); in AutoCloseInputStream() 207 mRemaining = (int)fd.getLength(); in AutoCloseInputStream() 291 public AutoCloseOutputStream(AssetFileDescriptor fd) throws IOException { in AutoCloseOutputStream() argument [all …]
|
/frameworks/rs/cpu_ref/linkloader/ |
D | main.cpp | 34 int &fd, 38 void close_mmap_file(int fd, 56 int fd = -1; in main() local 60 if (!open_mmap_file(filename, fd, image, image_size)) { in main() 68 close_mmap_file(fd, image, image_size); in main() 210 int &fd, in open_mmap_file() argument 228 fd = open(filename, O_RDONLY); in open_mmap_file() 229 if (fd < 0) { in open_mmap_file() 236 mmap(0, size, PROT_READ, MAP_PRIVATE, fd, 0)); in open_mmap_file() 240 close(fd); in open_mmap_file() [all …]
|
/frameworks/av/media/libcpustats/ |
D | ThreadCpuUsage.cpp | 174 int fd = open("/sys/devices/system/cpu/kernel_max", O_RDONLY); in init() local 175 if (fd >= 0) { in init() 178 ssize_t actual = read(fd, kernelMax, sizeof(kernelMax)); in init() 194 (void) close(fd); in init() 211 int fd = sScalingFds[cpuNum]; in getCpukHz() local 212 if (fd < 0) { in getCpukHz() 215 fd = sScalingFds[cpuNum]; in getCpukHz() 216 if (fd < 0) { in getCpukHz() 224 fd = open(freq_path, O_RDONLY | O_CLOEXEC); in getCpukHz() 226 sScalingFds[cpuNum] = fd; in getCpukHz() [all …]
|