Searched refs:fd (Results 1 - 25 of 473) 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.cpp30 bool SendProtocolString(int fd, const std::string& s) { argument
39 return WriteFdFmt(fd, "%04x%.*s", length, length, s.c_str());
42 bool ReadProtocolString(int fd, std::string* s, std::string* error) { argument
44 if (!ReadFdExactly(fd, buf, 4)) {
52 if (!ReadFdExactly(fd, &(*s)[0], len)) {
60 bool SendOkay(int fd) { argument
61 return WriteFdExactly(fd, "OKAY", 4);
64 bool SendFail(int fd, const std::string& reason) { argument
65 return WriteFdExactly(fd, "FAIL", 4) && SendProtocolString(fd, reaso
68 ReadFdExactly(int fd, void* buf, size_t len) argument
95 WriteFdExactly(int fd, const void* buf, size_t len) argument
124 WriteFdExactly(int fd, const char* str) argument
128 WriteFdExactly(int fd, const std::string& str) argument
132 WriteFdFmt(int fd, const char* fmt, ...) argument
143 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.cpp46 static int set_verity_enabled_state(int fd, const char *block_device, argument
50 WriteFdFmt(fd, "Could not make block device %s writable (%s).\n",
58 WriteFdFmt(fd, "Could not open block device %s (%s).\n", block_device, strerror(errno));
59 WriteFdFmt(fd, "Maybe run adb root?\n");
66 WriteFdFmt(fd, "Couldn't find verity metadata!\n");
71 WriteFdFmt(fd, "Verity already disabled on %s\n", mount_point);
76 WriteFdFmt(fd, "Verity already enabled on %s\n", mount_point);
81 WriteFdFmt(fd, "Could not set verity %s flag on device %s with error %s\n",
87 WriteFdFmt(fd, "Verity %s on %s\n", enable ? "enabled" : "disabled", mount_point);
91 void set_verity_enabled_state_service(int fd, voi argument
[all...]
H A Dadb_client.cpp72 static int switch_socket_transport(int fd, std::string* error) { argument
97 if (!SendProtocolString(fd, service)) {
99 adb_close(fd);
104 if (!adb_status(fd, error)) {
105 adb_close(fd);
113 bool adb_status(int fd, std::string* error) { argument
115 if (!ReadFdExactly(fd, buf, 4)) {
130 ReadProtocolString(fd, error, error);
142 int fd; local
145 fd
185 int fd = _adb_connect("host:version", error); local
276 int fd = adb_connect(service, &error); local
295 int fd = adb_connect(service, error); local
[all...]
H A Dadb_io_test.cpp36 // read()/write() if an unrecognized fd is used, and by making adb_open() return
43 ASSERT_NE(-1, tf.fd);
45 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno);
46 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET));
50 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno);
57 ASSERT_NE(-1, tf.fd);
59 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno);
60 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET));
64 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf)));
71 ASSERT_NE(-1, tf.fd);
118 int fd = open("/dev/full", O_WRONLY); 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.c54 int fd = TEMP_FAILURE_RETRY(open(ASHMEM_DEVICE, O_RDWR)); 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) argument
104 int fd = __ashmem_open_locked(); local
147 int fd = __ashmem_open(); local
176 ashmem_set_prot_region(int fd, int prot) argument
186 ashmem_pin_region(int fd, size_t offset, size_t len) argument
198 ashmem_unpin_region(int fd, size_t offset, size_t len) argument
210 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/connectivity/shill/
H A Dfile_io.cc41 ssize_t FileIO::Write(int fd, const void* buf, size_t count) { argument
42 return HANDLE_EINTR(write(fd, buf, count));
45 ssize_t FileIO::Read(int fd, void* buf, size_t count) { argument
46 return HANDLE_EINTR(read(fd, buf, count));
49 int FileIO::Close(int fd) { argument
50 return IGNORE_EINTR(close(fd));
53 int FileIO::SetFdNonBlocking(int fd) { argument
54 const int flags = HANDLE_EINTR(fcntl(fd, F_GETFL)) | O_NONBLOCK;
55 return HANDLE_EINTR(fcntl(fd, F_SETFL, flags));
H A Dmock_file_io.h30 MOCK_METHOD3(Write, ssize_t(int fd, const void* buf, size_t count));
31 MOCK_METHOD3(Read, ssize_t(int fd, void* buf, size_t count));
32 MOCK_METHOD1(Close, int(int fd));
33 MOCK_METHOD1(SetFdNonBlocking, int(int fd));
/system/core/trusty/libtrusty/
H A Dtrusty.c32 int fd; local
35 fd = open(dev_name, O_RDWR);
36 if (fd < 0) {
43 rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name);
48 close(fd);
52 ALOGV("%s: connected to \"%s\" fd %d\n", __func__, srv_name, fd);
53 return fd;
56 void tipc_close(int fd) argument
58 close(fd);
[all...]
/system/core/libziparchive/
H A Dzip_archive_private.h29 const int fd; member in struct:ZipArchive
46 ZipArchive(const int fd, bool assume_ownership) : argument
47 fd(fd),
55 if (close_file && fd >= 0) {
56 close(fd);
/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,
/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.c40 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)
59 close(semaphore->fd);
65 assert(semaphore->fd != INVALID_FD);
68 if (eventfd_read(semaphore->fd, &value) == -1)
74 assert(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/include/cutils/
H A Dashmem.h20 int ashmem_set_prot_region(int fd, int prot);
21 int ashmem_pin_region(int fd, size_t offset, size_t len);
22 int ashmem_unpin_region(int fd, size_t offset, size_t len);
23 int ashmem_get_size_region(int fd);
/system/core/trusty/libtrusty/include/trusty/
H A Dtipc.h25 int tipc_close(int fd);
/system/core/libion/
H A Dion.c36 int fd = open("/dev/ion", O_RDWR); local
37 if (fd < 0)
39 return fd;
42 int ion_close(int fd) argument
44 int ret = close(fd);
50 static int ion_ioctl(int fd, int req, void *arg) argument
52 int ret = ioctl(fd, req, arg);
61 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument
75 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data);
82 int ion_free(int fd, ion_user_handle_ argument
90 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
121 ion_share(int fd, ion_user_handle_t handle, int *share_fd) argument
142 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument
155 ion_import(int fd, int share_fd, ion_user_handle_t *handle) argument
172 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(const 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.c59 int fd; local
105 fd = open(path, flags);
109 if (fd != -1 && out_size != NULL) {
110 if (ioctl(fd, BLKGETSIZE64, out_size) != 0) {
111 close(fd);
116 return fd;
128 int fd; local
132 fd = boot_info_open_partition("misc", NULL, O_RDONLY);
133 if (fd == -1)
135 if (lseek(fd, BOOTINFO_OFFSE
151 int fd; local
[all...]
/system/extras/ext4_utils/
H A Dwipe.c35 int wipe_block_device(int fd, s64 len) argument
40 if (!is_block_device_fd(fd)) {
47 ret = ioctl(fd, BLKSECDISCARD, &range);
51 ret = ioctl(fd, BLKDISCARD, &range);
70 int wipe_block_device(int fd, s64 len) argument
/system/extras/tests/cpueater/
H A Dcpueater.c32 int fd; local
60 for (fd = 3; fd < 256; fd++) {
61 close(fd);

Completed in 4747 milliseconds

1234567891011>>