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

1234567891011

/system/core/adb/
H A Dconsole.c8 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 Dtransport.h24 int readx(int fd, void *ptr, size_t len);
25 int writex(int fd, const void *ptr, size_t len);
H A Dadb_client.c92 static int switch_socket_transport(int fd) argument
124 if(writex(fd, tmp, 4) || writex(fd, service, len)) {
126 adb_close(fd);
131 if(adb_status(fd)) {
132 adb_close(fd);
140 int adb_status(int fd) argument
145 if(readx(fd, buf, 4)) {
161 if(readx(fd, buf, 4)) {
168 if(readx(fd, __adb_erro
180 int fd; local
222 int fd = _adb_connect("host:version"); local
297 int fd = adb_connect(service); local
318 int fd = adb_connect(service); local
[all...]
H A Dremount_service.c39 int fd; local
45 fd = unix_open("/proc/mounts", O_RDONLY | O_CLOEXEC);
46 if (fd < 0)
50 adb_read(fd, buf, sizeof(buf) - 1);
51 adb_close(fd);
86 int fd; local
98 fd = unix_open(dev, O_RDONLY | O_CLOEXEC);
99 if (fd < 0)
102 ioctl(fd, BLKROSET, &OFF);
103 adb_close(fd);
112 write_string(int fd, const char* str) argument
117 remount_service(int fd, void *cookie) argument
[all...]
H A Ddisable_verity_service.c36 static void write_console(int fd, const char* format, ...) argument
44 adb_write(fd, buffer, strnlen(buffer, sizeof(buffer)));
47 static int get_target_device_size(int fd, const char *blk_device, argument
58 write_console(fd, "Error opening block device (%s)\n", strerror(errno));
63 write_console(fd, "Error seeking to superblock\n");
69 write_console(fd, "Error reading superblock\n");
81 static int disable_verity(int fd, const char *block_device, argument
92 write_console(fd, "Could not open block device %s (%s).\n",
94 write_console(fd, "Maybe run adb remount?\n");
99 if (get_target_device_size(fd, (cha
149 disable_verity_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.c53 int fd; local
71 fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600);
72 if (fd == -1) {
78 } while (fd == -1);
80 if (ftruncate(fd, size) != -1 && unlink(name) != -1) {
81 return fd;
83 close(fd);
87 int ashmem_set_prot_region(int fd __unused, int prot __unused)
92 int ashmem_pin_region(int fd __unused, size_t offset __unused, size_t len __unused)
97 int ashmem_unpin_region(int fd __unuse
102 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/core/fastbootd/
H A Dsocket_client.c46 int fd; local
51 fd = socket_local_client("fastbootd",
55 if (fd < 0) {
60 fds[0].fd = STDIN_FD;
62 fds[1].fd = fd;
76 if (bulk_write(fd, buffer, n) < 0) {
82 if ((n = read(fd, buffer, BUFFER_SIZE)) < 0) {
H A Dutils.h41 uint64_t get_file_size64(int fd);
42 uint64_t get_file_size(int fd);
43 uint64_t get_block_device_size(int fd);
44 int wipe_block_device(int fd, int64_t len);
/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/vold/
H A DVoldUtil.c20 unsigned int get_blkdev_size(int fd) argument
24 if ( (ioctl(fd, BLKGETSIZE, &nr_sec)) == -1) {
H A DLoop.cpp41 int fd; local
50 if ((fd = open(filename, O_RDWR)) < 0) {
59 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
60 close(fd);
83 int fd; local
94 if ((fd = open(filename, O_RDWR)) < 0) {
103 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
104 close(fd);
129 int fd; local
151 if ((fd
236 int fd; local
253 int fd; local
281 int fd; local
[all...]
H A DVoldUtil.h25 unsigned int get_blkdev_size(int fd);
/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/extras/tests/cpueater/
H A Dcpueater.c32 int fd; local
60 for (fd = 3; fd < 256; fd++) {
61 close(fd);
/system/core/libion/
H A Dion.c35 int fd = open("/dev/ion", O_RDWR); local
36 if (fd < 0)
38 return fd;
41 int ion_close(int fd) argument
43 int ret = close(fd);
49 static int ion_ioctl(int fd, int req, void *arg) argument
51 int ret = ioctl(fd, req, arg);
60 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument
74 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data);
81 int ion_free(int fd, ion_user_handle_ argument
89 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
118 ion_share(int fd, ion_user_handle_t handle, int *share_fd) argument
140 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument
153 ion_import(int fd, int share_fd, ion_user_handle_t *handle) argument
170 ion_sync_fd(int fd, int handle_fd) argument
[all...]
/system/core/init/
H A Dwatchdogd.c31 int fd; local
50 fd = open(DEV_NAME, O_RDWR);
51 if (fd < 0) {
56 ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
59 ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
73 write(fd, "", 1);
/system/core/toolbox/
H A Dsmd.c9 int fd, len, r, port = 0; local
21 fd = open(devname, O_WRONLY);
22 if(fd < 0) {
29 r = write(fd, argv[0], len);
37 write(fd, argc ? " " : "\r", 1);
39 close(fd);
/system/core/include/utils/
H A DCompat.h30 static inline off64_t lseek64(int fd, off64_t offset, int whence) { argument
31 return lseek(fd, offset, whence);
35 static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { argument
36 return pread(fd, buf, nbytes, offset);
/system/extras/f2fs_utils/
H A Dmake_f2fs.h26 int make_f2fs_sparse_fd(int fd, long long len,

Completed in 1004 milliseconds

1234567891011