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

1234567891011>>

/system/core/adb/
H A Dconsole.cpp8 int fd, port; local
18 fd = socket_loopback_client( port, SOCK_STREAM );
19 if (fd < 0) {
23 return fd;
29 int fd, nn; local
31 fd = connect_to_console();
32 if (fd < 0)
38 adb_write( fd, argv[nn], strlen(argv[nn]) );
39 adb_write( fd, (nn == argc-1) ? "\n" : " ", 1 );
41 adb_write( fd, QUI
[all...]
H A Dadb_io.cpp29 bool SendProtocolString(int fd, const std::string& s) { argument
35 return WriteFdFmt(fd, "%04x", length) && WriteFdExactly(fd, s);
38 bool SendOkay(int fd) { argument
39 return WriteFdExactly(fd, "OKAY", 4);
42 bool SendFail(int fd, const std::string& reason) { argument
43 return WriteFdExactly(fd, "FAIL", 4) && SendProtocolString(fd, reason);
46 bool ReadFdExactly(int fd, void* buf, size_t len) { argument
51 D("readx: fd
75 WriteFdExactly(int fd, const void* buf, size_t len) argument
106 WriteFdExactly(int fd, const char* str) argument
110 WriteFdExactly(int fd, const std::string& str) argument
114 WriteFdFmt(int fd, const char* fmt, ...) argument
[all...]
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 * Reads exactly len bytes from fd into buf.
41 bool ReadFdExactly(int fd, void *buf, size_t len);
44 * Writes exactly len bytes from buf to fd.
46 * Returns false if there is an error or if the fd was closed before the write
47 * completed. If the other end of the fd (such as in a socket, pipe, or fifo),
50 bool WriteFdExactly(int fd, const void* buf, size_t len);
53 bool WriteFdExactly(int fd, cons
[all...]
H A Dadb_io_test.cpp36 if (fd == -1) {
42 close(fd);
46 int fd; member in class:TemporaryFile
52 fd = mkstemp(filename);
59 ASSERT_NE(-1, tf.fd);
61 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno);
62 ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
66 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno);
73 ASSERT_NE(-1, tf.fd);
75 ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerro
134 int fd = open("/dev/full", O_WRONLY); local
[all...]
H A Dremount_service.cpp54 int fd = unix_open(dev.c_str(), O_RDONLY | O_CLOEXEC); local
55 if (fd == -1) {
60 bool result = (ioctl(fd, BLKROSET, &OFF) != -1);
61 adb_close(fd);
65 static bool remount_partition(int fd, const char* dir) { argument
74 WriteFdFmt(fd, "remount of %s failed; couldn't make block device %s writable: %s\n",
79 WriteFdFmt(fd, "remount of %s failed: %s\n", dir, strerror(errno));
85 void remount_service(int fd, void* cookie) { argument
87 WriteFdExactly(fd, "Not running as root. Try \"adb root\" first.\n");
88 adb_close(fd);
[all...]
H A Dadb_client.cpp49 static bool ReadProtocolString(int fd, std::string* s, std::string* error) { argument
51 if (!ReadFdExactly(fd, buf, 4)) {
59 if (!ReadFdExactly(fd, &(*s)[0], len)) {
113 static int switch_socket_transport(int fd, std::string* error) { argument
138 if (!SendProtocolString(fd, service)) {
140 adb_close(fd);
145 if (!adb_status(fd, error)) {
146 adb_close(fd);
154 bool adb_status(int fd, std::string* error) { argument
156 if (!ReadFdExactly(fd, bu
183 int fd; local
215 int fd = _adb_connect("host:version", error); local
290 int fd = adb_connect(service, error); local
306 int fd = adb_connect(service, error); local
[all...]
H A Dset_verity_enable_state_service.cpp44 static int get_target_device_size(int fd, const char *blk_device, argument
55 WriteFdFmt(fd, "Error opening block device (%s)\n", strerror(errno));
60 WriteFdFmt(fd, "Error seeking to superblock\n");
66 WriteFdFmt(fd, "Error reading superblock\n");
79 static int set_verity_enabled_state(int fd, const char *block_device, argument
90 WriteFdFmt(fd, "Could not make block device %s writable (%s).\n",
97 WriteFdFmt(fd, "Could not open block device %s (%s).\n", block_device, strerror(errno));
98 WriteFdFmt(fd, "Maybe run adb remount?\n");
103 if (get_target_device_size(fd, (char*)block_device, &device_length) < 0) {
104 WriteFdFmt(fd, "Coul
155 set_verity_enabled_state_service(int fd, void* cookie) argument
[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.c44 int fd, ret; local
46 fd = open(ASHMEM_DEVICE, O_RDWR);
47 if (fd < 0)
48 return fd;
54 ret = ioctl(fd, ASHMEM_SET_NAME, buf);
59 ret = ioctl(fd, ASHMEM_SET_SIZE, size);
63 return fd;
66 close(fd);
70 int ashmem_set_prot_region(int fd, int prot) argument
72 return ioctl(fd, ASHMEM_SET_PROT_MAS
75 ashmem_pin_region(int fd, size_t offset, size_t len) argument
81 ashmem_unpin_region(int fd, size_t offset, size_t len) argument
87 ashmem_get_size_region(int fd) argument
[all...]
H A Dashmem-host.c45 int fd = mkstemp(template); local
46 if (fd != -1 && TEMP_FAILURE_RETRY(ftruncate(fd, size)) != -1 && unlink(template) != -1) {
47 return fd;
49 close(fd);
53 int ashmem_set_prot_region(int fd __unused, int prot __unused)
58 int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused)
63 int ashmem_unpin_region(int fd __unused, size_t offset __unused, size_t len __unused)
68 int ashmem_get_size_region(int fd) argument
71 int result = fstat(fd,
[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) {
H A DLoop.cpp43 int fd; local
52 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
61 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
62 close(fd);
85 int fd; local
96 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
105 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
106 close(fd);
131 int fd; local
171 if ((fd
256 int fd; local
273 int fd; local
301 int fd; local
[all...]
/system/bt/btif/include/
H A Dbtif_debug.h26 void btif_debug_dump(int 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.h25 int fakeLogClose(int fd);
26 ssize_t fakeLogWritev(int fd, const struct iovec* vector, int count);
/system/bt/btif/src/
H A Dbtif_debug.c33 void btif_debug_dump(int fd) { argument
34 btif_debug_conn_dump(fd);
36 btif_debug_btsnoop_dump(fd);
39 close(fd);
/system/bt/osi/src/
H A Dsemaphore.c38 int fd; member in struct:semaphore_t
44 ret->fd = eventfd(value, EFD_SEMAPHORE);
45 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("%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/extras/ext4_utils/
H A Dwipe.h31 int wipe_block_device(int fd, s64 len);
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/core/base/
H A Dtest_utils.cpp25 if (fd == -1) {
31 close(fd);
37 fd = mkstemp(filename);
/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/extras/tests/cpueater/
H A Dcpueater.c32 int fd; local
60 for (fd = 3; fd < 256; fd++) {
61 close(fd);
/system/bt/test/suite/cases/
H A Drfcomm.c30 static bool handshake(int fd) { argument
31 TASSERT(write(fd, HANDSHAKE_COMMAND, sizeof(HANDSHAKE_COMMAND)) == sizeof(HANDSHAKE_COMMAND), "Unable to send HFP handshake.");
36 ssize_t len = read(fd, response + total, sizeof(response) - total);
45 int fd; local
48 error = socket_interface->connect(&bt_remote_bdaddr, BTSOCK_RFCOMM, (const uint8_t *)&HFP_AG_UUID, 0, &fd, 0);
50 TASSERT(fd != -1, "Error creating RFCOMM socket: invalid fd");
54 TASSERT(read(fd, &channel, sizeof(channel)) == sizeof(channel), "Channel not read from RFCOMM socket.");
55 TASSERT(read(fd, &signal, sizeof(signal)) == sizeof(signal), "Connection signal not read from RFCOMM socket.");
60 if (!handshake(fd))
[all...]

Completed in 850 milliseconds

1234567891011>>