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

1234567891011>>

/system/core/adb/
H A Dadb_io.h25 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 Dadb_io.cpp32 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 Dsysdeps_unix.cpp19 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 Dset_verity_enable_state_service.cpp48 static int set_verity_enabled_state(int fd, const char *block_device, 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);
93 void set_verity_enabled_state_service(int fd, voi argument
[all...]
H A Dadb_io_test.cpp36 // 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 Dadb_client.cpp61 static int switch_socket_transport(int fd, std::string* error) { argument
86 if (!SendProtocolString(fd, service)) {
88 adb_close(fd);
93 if (!adb_status(fd, error)) {
94 adb_close(fd);
102 bool adb_status(int fd, std::string* error) { argument
104 if (!ReadFdExactly(fd, buf, 4)) {
119 ReadProtocolString(fd, error, error);
132 int fd = socket_spec_connect(__adb_server_socket_spec, &reason); local
133 if (fd <
163 int fd = _adb_connect("host:version", error); local
253 int fd = adb_connect(service, &error); local
272 int fd = adb_connect(service, error); local
[all...]
/system/core/libcutils/
H A Dload_file.c26 int fd; local
29 fd = open(fn, O_RDONLY);
30 if(fd < 0) return 0;
32 sz = lseek(fd, 0, SEEK_END);
35 if(lseek(fd, 0, SEEK_SET) != 0) goto oops;
40 if(read(fd, data, sz) != sz) goto oops;
41 close(fd);
48 close(fd);
H A Dashmem-dev.c53 int fd = TEMP_FAILURE_RETRY(open(ASHMEM_DEVICE, O_RDWR)); local
54 if (fd < 0) {
55 return fd;
58 ret = TEMP_FAILURE_RETRY(fstat(fd, &st));
61 close(fd);
66 close(fd);
72 return fd;
77 int fd; local
80 fd = __ashmem_open_locked();
83 return fd;
87 __ashmem_is_ashmem(int fd, int fatal) argument
103 int fd = __ashmem_open_locked(); local
137 ashmem_valid(int fd) argument
153 int fd = __ashmem_open(); local
182 ashmem_set_prot_region(int fd, int prot) argument
192 ashmem_pin_region(int fd, size_t offset, size_t len) argument
204 ashmem_unpin_region(int fd, size_t offset, size_t len) argument
216 ashmem_get_size_region(int fd) argument
[all...]
/system/core/libsync/
H A Dsw_sync.h30 int sw_sync_timeline_inc(int fd, unsigned count);
31 int sw_sync_fence_create(int fd, const char *name, unsigned value);
/system/vold/
H A DVoldUtil.c20 void get_blkdev_size(int fd, unsigned long* nr_sec) { argument
21 if ((ioctl(fd, BLKGETSIZE, nr_sec)) == -1) {
/system/core/include/cutils/
H A Dashmem.h23 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 Dashmem.h23 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 Dashmem.h23 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 Dtrusty.c34 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/include/utils/
H A DCompat.h28 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/libion/include/ion/
H A Dion.h32 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);
/system/core/liblog/
H A Dfake_log_device.h27 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 DCompat.h28 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/extras/multinetwork/
H A Dcommon.h57 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/bt/osi/src/
H A Dsemaphore.cc40 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 Dtipc.h25 int tipc_close(int fd);
/system/core/libion/
H A Dion.c37 int fd = open("/dev/ion", O_RDONLY | O_CLOEXEC); local
38 if (fd < 0)
40 return fd;
43 int ion_close(int fd) argument
45 int ret = close(fd);
51 static int ion_ioctl(int fd, int req, void *arg) argument
53 int ret = ioctl(fd, req, arg);
62 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument
76 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data);
83 int ion_free(int fd, ion_user_handle_ argument
91 ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd) argument
122 ion_share(int fd, ion_user_handle_t handle, int *share_fd) argument
143 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument
156 ion_import(int fd, int share_fd, ion_user_handle_t *handle) argument
173 ion_sync_fd(int fd, int handle_fd) argument
[all...]
/system/bt/vendor_libs/test_vendor_lib/include/
H A Dpacket_stream.h37 // Reads a command packet from the file descriptor at |fd| and returns the
40 std::unique_ptr<CommandPacket> ReceiveCommand(int fd) const;
42 // Reads a single octet from |fd| and interprets it as a packet type octet.
44 serial_data_type_t ReceivePacketType(int fd) const;
46 // Sends an event to file descriptor |fd|. The ownership of the event is left
48 bool SendEvent(std::unique_ptr<EventPacket> event, int fd) const;
55 // Attempts to receive |num_octets_to_receive| into |destination| from |fd|,
58 size_t num_octets_to_receive, int fd) const;
60 // Attempts to send |num_octets_to_send| from |source| to |fd|, returning
63 int fd) cons
[all...]
/system/extras/boot_control_copy/
H A Dbootinfo.c53 int fd; local
99 fd = open(path, flags);
103 if (fd != -1 && out_size != NULL) {
104 if (ioctl(fd, BLKGETSIZE64, out_size) != 0) {
105 close(fd);
110 return fd;
122 int fd; local
126 fd = boot_info_open_partition("misc", NULL, O_RDONLY);
127 if (fd == -1)
129 if (lseek(fd, BOOTINFO_OFFSE
145 int fd; local
[all...]
/system/extras/ext4_utils/
H A Dwipe.c36 int wipe_block_device(int fd, s64 len) argument
41 if (!is_block_device_fd(fd)) {
48 ret = ioctl(fd, BLKSECDISCARD, &range);
52 ret = ioctl(fd, BLKDISCARD, &range);
71 int wipe_block_device(int fd, s64 len) argument

Completed in 389 milliseconds

1234567891011>>