/system/netd/libnetdutils/ |
H A D | UniqueFd.cpp | 25 void UniqueFd::reset(Fd fd) { argument 27 std::swap(fd, mFd); 28 if (isWellFormed(fd)) { 29 expectOk(sys.close(fd)); 33 std::ostream& operator<<(std::ostream& os, const UniqueFd& fd) { argument 34 return os << "UniqueFd[" << static_cast<Fd>(fd) << "]";
|
H A D | Fd.cpp | 22 std::ostream& operator<<(std::ostream& os, const Fd& fd) { argument 23 return os << "Fd[" << fd.get() << "]";
|
/system/core/adb/ |
H A D | adb_io.h | 25 bool SendOkay(int fd); 28 bool SendFail(int fd, const std::string& reason); 31 bool SendProtocolString(int fd, const std::string& s); 34 bool ReadProtocolString(int fd, std::string* s, std::string* error); 36 // Reads exactly len bytes from fd into buf. 42 bool ReadFdExactly(int fd, void* buf, size_t len); 60 bool ReadOrderlyShutdown(int fd); 62 // Writes exactly len bytes from buf to fd. 64 // Returns false if there is an error or if the fd was closed before the write 65 // completed. If the other end of the fd (suc [all...] |
H A D | adb_io.cpp | 32 bool SendProtocolString(int fd, const std::string& s) { argument 41 return WriteFdFmt(fd, "%04x%.*s", length, length, s.c_str()); 44 bool ReadProtocolString(int fd, std::string* s, std::string* error) { argument 46 if (!ReadFdExactly(fd, buf, 4)) { 54 if (!ReadFdExactly(fd, &(*s)[0], len)) { 62 bool SendOkay(int fd) { argument 63 return WriteFdExactly(fd, "OKAY", 4); 66 bool SendFail(int fd, const std::string& reason) { argument 67 return WriteFdExactly(fd, "FAIL", 4) && SendProtocolString(fd, reaso 70 ReadFdExactly(int fd, void* buf, size_t len) argument 97 WriteFdExactly(int fd, const void* buf, size_t len) argument 126 WriteFdExactly(int fd, const char* str) argument 130 WriteFdExactly(int fd, const std::string& str) argument 134 WriteFdFmt(int fd, const char* fmt, ...) argument 145 ReadOrderlyShutdown(int fd) argument [all...] |
H A D | set_verity_enable_state_service.cpp | 49 static bool set_verity_enabled_state(int fd, const char* block_device, const char* mount_point, argument 52 WriteFdFmt(fd, "Could not make block device %s writable (%s).\n", 60 WriteFdFmt(fd, "Could not open block device %s (%s).\n", block_device, strerror(errno)); 61 WriteFdFmt(fd, "Maybe run adb root?\n"); 68 WriteFdFmt(fd, "Couldn't find verity metadata!\n"); 73 WriteFdFmt(fd, "Verity already disabled on %s\n", mount_point); 78 WriteFdFmt(fd, "Verity already enabled on %s\n", mount_point); 83 WriteFdFmt(fd, "Could not set verity %s flag on device %s with error %s\n", 89 WriteFdFmt(fd, "Verity %s on %s\n", enable ? "enabled" : "disabled", mount_point); 106 static bool set_avb_verity_enabled_state(int fd, AvbOp argument 134 set_verity_enabled_state_service(int fd, void* cookie) argument [all...] |
H A D | sysdeps_unix.cpp | 19 bool set_tcp_keepalive(int fd, int interval_sec) { argument 21 if (adb_setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable))) { 31 if (adb_setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &interval_sec, sizeof(interval_sec))) { 35 if (adb_setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &interval_sec, sizeof(interval_sec))) { 42 if (adb_setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &interval_sec, sizeof(interval_sec))) { 52 if (adb_setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) {
|
H A D | adb_io_test.cpp | 36 // read()/write() if an unrecognized fd is used, and by making adb_open() return 49 ASSERT_NE(-1, tf.fd); 51 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno); 52 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); 56 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno); 63 ASSERT_NE(-1, tf.fd); 65 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno); 66 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)); 70 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf))); 77 ASSERT_NE(-1, tf.fd); 124 int fd = open("/dev/full", O_WRONLY); local [all...] |
H A D | adb_client.cpp | 73 static int switch_socket_transport(int fd, std::string* error) { argument 101 if (!SendProtocolString(fd, service)) { 103 adb_close(fd); 108 if (!adb_status(fd, error)) { 109 adb_close(fd); 117 bool adb_status(int fd, std::string* error) { argument 119 if (!ReadFdExactly(fd, buf, 4)) { 134 ReadProtocolString(fd, error, error); 147 int fd = socket_spec_connect(__adb_server_socket_spec, &reason); local 148 if (fd < 176 int fd = socket_spec_connect(__adb_server_socket_spec, &reason); local 194 int fd = _adb_connect("host:version", error); local 272 int fd = adb_connect(service, &error); local 291 int fd = adb_connect(service, error); local [all...] |
/system/core/libcutils/ |
H A D | load_file.cpp | 28 int fd; local 31 fd = open(fn, O_RDONLY); 32 if(fd < 0) return 0; 34 sz = lseek(fd, 0, SEEK_END); 37 if(lseek(fd, 0, SEEK_SET) != 0) goto oops; 42 if(read(fd, data, sz) != sz) goto oops; 43 close(fd); 50 close(fd);
|
H A D | ashmem-dev.cpp | 54 int fd = TEMP_FAILURE_RETRY(open(ASHMEM_DEVICE, O_RDWR | O_CLOEXEC)); local 55 if (fd < 0) { 56 return fd; 59 ret = TEMP_FAILURE_RETRY(fstat(fd, &st)); 62 close(fd); 67 close(fd); 73 return fd; 78 int fd; local 81 fd = __ashmem_open_locked(); 84 return fd; 88 __ashmem_is_ashmem(int fd, int fatal) argument 104 int fd = __ashmem_open_locked(); local 138 ashmem_valid(int fd) argument 154 int fd = __ashmem_open(); local 183 ashmem_set_prot_region(int fd, int prot) argument 193 ashmem_pin_region(int fd, size_t offset, size_t len) argument 206 ashmem_unpin_region(int fd, size_t offset, size_t len) argument 219 ashmem_get_size_region(int fd) argument [all...] |
/system/core/libsync/ |
H A D | sw_sync.h | 30 int sw_sync_timeline_inc(int fd, unsigned count); 31 int sw_sync_fence_create(int fd, const char *name, unsigned value);
|
/system/core/libion/include/ion/ |
H A D | ion.h | 32 int ion_close(int fd); 33 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, 35 int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, 37 int ion_sync_fd(int fd, int handle_fd); 38 int ion_free(int fd, ion_user_handle_t handle); 39 int ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, 41 int ion_share(int fd, ion_user_handle_t handle, int *share_fd); 42 int ion_import(int fd, int share_fd, ion_user_handle_t *handle); 48 int ion_query_heap_cnt(int fd, int* cnt); 49 int ion_query_get_heaps(int fd, in [all...] |
/system/core/include/cutils/ |
H A D | ashmem.h | 23 int ashmem_valid(int fd); 25 int ashmem_set_prot_region(int fd, int prot); 26 int ashmem_pin_region(int fd, size_t offset, size_t len); 27 int ashmem_unpin_region(int fd, size_t offset, size_t len); 28 int ashmem_get_size_region(int fd);
|
/system/core/libcutils/include/cutils/ |
H A D | ashmem.h | 23 int ashmem_valid(int fd); 25 int ashmem_set_prot_region(int fd, int prot); 26 int ashmem_pin_region(int fd, size_t offset, size_t len); 27 int ashmem_unpin_region(int fd, size_t offset, size_t len); 28 int ashmem_get_size_region(int fd);
|
/system/core/libcutils/include_vndk/cutils/ |
H A D | ashmem.h | 23 int ashmem_valid(int fd); 25 int ashmem_set_prot_region(int fd, int prot); 26 int ashmem_pin_region(int fd, size_t offset, size_t len); 27 int ashmem_unpin_region(int fd, size_t offset, size_t len); 28 int ashmem_get_size_region(int fd);
|
/system/core/trusty/libtrusty/ |
H A D | trusty.c | 34 int fd; local 37 fd = open(dev_name, O_RDWR); 38 if (fd < 0) { 45 rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name); 50 close(fd); 54 ALOGV("%s: connected to \"%s\" fd %d\n", __func__, srv_name, fd); 55 return fd; 58 void tipc_close(int fd) argument 60 close(fd); [all...] |
/system/core/qemu_pipe/ |
H A D | qemu_pipe.cpp | 44 int fd = TEMP_FAILURE_RETRY(open("/dev/qemu_pipe", O_RDWR)); local 45 if (fd < 0) { 53 if (WriteFully(fd, pipeName, pipeNameLen + 1U)) { 54 return fd; 61 if (WriteFully(fd, pipe_prefix, strlen(pipe_prefix)) && 62 WriteFully(fd, pipeName, pipeNameLen + 1U)) { 63 return fd; 67 close(fd); 71 int qemu_pipe_frame_send(int fd, const void* buff, size_t len) { argument 74 if (!WriteFully(fd, heade 85 qemu_pipe_frame_recv(int fd, void* buff, size_t len) argument [all...] |
/system/core/include/utils/ |
H A D | Compat.h | 28 static inline off64_t lseek64(int fd, off64_t offset, int whence) { argument 29 return lseek(fd, offset, whence); 32 static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { argument 33 return pread(fd, buf, nbytes, offset); 36 static inline ssize_t pwrite64(int fd, const void* buf, size_t nbytes, off64_t offset) { argument 37 return pwrite(fd, buf, nbytes, offset); 40 static inline int ftruncate64(int fd, off64_t length) { argument 41 return ftruncate(fd, length);
|
/system/core/liblog/ |
H A D | fake_log_device.h | 27 LIBLOG_HIDDEN int fakeLogClose(int fd); 28 LIBLOG_HIDDEN ssize_t fakeLogWritev(int fd, const struct iovec* vector,
|
/system/core/libutils/include/utils/ |
H A D | Compat.h | 28 static inline off64_t lseek64(int fd, off64_t offset, int whence) { argument 29 return lseek(fd, offset, whence); 32 static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { argument 33 return pread(fd, buf, nbytes, offset); 36 static inline ssize_t pwrite64(int fd, const void* buf, size_t nbytes, off64_t offset) { argument 37 return pwrite(fd, buf, nbytes, offset); 40 static inline int ftruncate64(int fd, off64_t length) { argument 41 return ftruncate(fd, length);
|
/system/core/qemu_pipe/include/ |
H A D | qemu_pipe.h | 48 // Send a framed message |buff| of |len| bytes through the |fd| descriptor. 51 int qemu_pipe_frame_send(int fd, const void* buff, size_t len); 53 // Read a frame message from |fd|, and store it into |buff| of |len| bytes. 58 int qemu_pipe_frame_recv(int fd, void* buff, size_t len);
|
/system/extras/multinetwork/ |
H A D | common.h | 57 FdAutoCloser() : fd(-1) {} 58 /* not explicit */ FdAutoCloser(int fd) : fd(fd) {} argument 60 if (fd > -1) { 61 close(fd); 63 fd = -1; 66 int fd; member in struct:FdAutoCloser
|
/system/vold/ |
H A D | VoldUtil.cpp | 22 void get_blkdev_size(int fd, unsigned long* nr_sec) { argument 23 if ((ioctl(fd, BLKGETSIZE, nr_sec)) == -1) {
|
/system/bt/osi/src/ |
H A D | semaphore.cc | 40 int fd; member in struct:semaphore_t 45 ret->fd = eventfd(value, EFD_SEMAPHORE); 46 if (ret->fd == INVALID_FD) { 58 if (semaphore->fd != INVALID_FD) close(semaphore->fd); 64 CHECK(semaphore->fd != INVALID_FD); 67 if (eventfd_read(semaphore->fd, &value) == -1) 74 CHECK(semaphore->fd != INVALID_FD); 76 int flags = fcntl(semaphore->fd, F_GETFL); 78 LOG_ERROR(LOG_TAG, "%s unable to get flags for semaphore fd [all...] |
/system/core/trusty/libtrusty/include/trusty/ |
H A D | tipc.h | 25 int tipc_close(int fd);
|