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

123456789

/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.c86 static int switch_socket_transport(int fd) argument
118 if(writex(fd, tmp, 4) || writex(fd, service, len)) {
120 adb_close(fd);
125 if(adb_status(fd)) {
126 adb_close(fd);
134 int adb_status(int fd) argument
139 if(readx(fd, buf, 4)) {
155 if(readx(fd, buf, 4)) {
162 if(readx(fd, __adb_erro
174 int fd; local
212 int fd = _adb_connect("host:version"); local
282 int fd = adb_connect(service); local
302 int fd = adb_connect(service); local
[all...]
H A Dremount_service.c36 int fd; local
43 fd = unix_open("/proc/mounts", O_RDONLY);
44 if (fd < 0)
48 size = adb_read(fd, buf, sizeof(buf) - 1);
49 adb_close(fd);
92 static void write_string(int fd, const char* str) argument
94 writex(fd, str, strlen(str));
97 void remount_service(int fd, void *cookie) argument
102 write_string(fd, "remount succeeded\n");
106 write_string(fd, buffe
[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.c42 int fd; local
60 fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600);
61 if (fd == -1) {
69 if (ftruncate(fd, size) == -1)
75 return fd;
77 close(fd);
81 int ashmem_set_prot_region(int fd, int prot) argument
86 int ashmem_pin_region(int fd, size_t offset, size_t len) argument
91 int ashmem_unpin_region(int fd, size_t offset, size_t len) argument
96 int ashmem_get_size_region(int fd) argument
[all...]
/system/bluetooth/tools/
H A Dpipetest.c37 static int _socketpair(int fd[2]) { argument
40 ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
46 static int _close(int fd) { argument
48 printf("%d: close(%d)\n", gettid(), fd);
49 ret = close(fd);
50 printf("%d: close(%d) = %d\n", gettid(), fd, ret);
65 printf("\tfd %d ", ufds[i].fd); print_events(ufds[i].revents);
72 static int _write(int fd, char *buf, int len) { argument
75 printf("%d: write(%d)\n", gettid(), fd);
76 ret = write(fd, bu
83 _read(int fd) argument
95 _shutdown(int fd, int how) argument
106 int fd = (int)args; local
116 int fd = (int)args; local
126 int fd = (int)args; local
138 int fd = (int)args; local
145 int fd = (int)args; local
154 int fd[2]; local
172 int fd[2]; local
193 int fd[2]; local
214 int fd[2]; local
231 int fd[2]; local
252 int fd[2]; local
270 int fd[2]; local
293 int fd[2]; local
342 int fd[2]; local
360 int fd[2]; local
371 int fd[2]; local
[all...]
H A Dsocktest.c51 int fd; member in struct:thread_args
81 printf("%d ", ufds[i].fd);
126 static int _close(int fd, int type) { argument
129 printf("%ld: close(%d)\n", pthread_self(), fd);
130 ret = close(fd);
131 printf("%ld: close(%d) = %d\n", pthread_self(), fd, ret);
137 static int _bind(int fd, int type) { argument
166 printf("%ld: bind(%d)\n", pthread_self(), fd);
167 ret = bind(fd, addr, len);
168 printf("%ld: bind(%d) = %d\n", pthread_self(), fd, re
174 _listen(int fd, int type) argument
185 _read(int fd) argument
198 _accept(int fd, int type) argument
251 _connect(int fd, int type) argument
288 _write(int fd, int type) argument
300 _shutdown(int fd, int how) argument
339 int fd = (int)args; local
349 int fd = (int)args; local
356 int fd = (int)args; local
365 thread_shutdown(int fd) argument
413 int fd; local
433 int fd; local
458 int fd; local
486 int fd; local
510 int fd; local
541 int fd; local
569 int fd; local
595 int fd; local
618 int fd; local
639 int fd; local
660 int fd; local
716 int fd; local
[all...]
H A Dasocket_test.c52 int fd; member in struct:thread_args
82 printf("%d ", ufds[i].fd);
127 static int _close(int fd, int type) { argument
130 printf("%d: close(%d)\n", gettid(), fd);
131 ret = close(fd);
132 printf("%d: close(%d) = %d\n", gettid(), fd, ret);
138 static int _bind(int fd, int type) { argument
167 printf("%d: bind(%d)\n", gettid(), fd);
168 ret = bind(fd, addr, len);
169 printf("%d: bind(%d) = %d\n", gettid(), fd, re
175 _listen(int fd, int type) argument
186 _read(int fd) argument
199 _accept(int fd, int type) argument
238 _connect(int fd, int type) argument
274 _write(int fd, int type) argument
286 _shutdown(int fd, int how) argument
325 int fd = (int)args; local
335 int fd = (int)args; local
342 int fd = (int)args; local
351 thread_shutdown(int fd) argument
399 int fd; local
419 int fd; local
444 int fd; local
472 int fd; local
497 int fd; local
523 int fd; local
546 int fd; local
567 int fd; local
588 int fd; local
644 int fd; local
[all...]
H A Dsock_shutdown_bug_l2cap.c27 int fd; local
36 fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
37 flags = fcntl(fd, F_GETFL);
38 fcntl(fd, F_SETFL, flags | O_NONBLOCK);
40 connect(fd, (struct sockaddr *)&addr, sizeof(addr));
43 shutdown(fd, SHUT_RDWR);
45 close(fd);
H A Dsock_shutdown_bug_tcp.c26 int fd; local
34 fd = socket(PF_INET, SOCK_STREAM, 0);
36 ret = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
41 ret = listen(fd, 1);
48 close(fd);
52 fd = socket(PF_INET, SOCK_STREAM, 0);
54 ret = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
H A Dsock_shutdown_bug_rfcomm.c28 int fd; local
37 fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
38 flags = fcntl(fd, F_GETFL);
39 fcntl(fd, F_SETFL, flags | O_NONBLOCK);
41 ret = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
47 shutdown(fd, SHUT_RDWR);
50 fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
52 ret = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
59 shutdown(fd, SHUT_RDWR);
/system/extras/ext4_utils/
H A Dwipe.h20 int wipe_block_device(int fd, s64 len);
H A Dwipe.c33 int wipe_block_device(int fd, s64 len) argument
40 ret = ioctl(fd, BLKSECDISCARD, &range);
44 ret = ioctl(fd, BLKDISCARD, &range);
57 int wipe_block_device(int fd, s64 len) argument
/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 return close(fd);
46 static int ion_ioctl(int fd, int req, void *arg) argument
48 int ret = ioctl(fd, req, arg);
57 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument
68 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data);
75 int ion_free(int fd, struc argument
83 ion_map(int fd, struct ion_handle *handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd) argument
106 ion_share(int fd, struct ion_handle *handle, int *share_fd) argument
124 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument
137 ion_import(int fd, int share_fd, struct ion_handle **handle) argument
150 ion_sync_fd(int fd, int handle_fd) argument
[all...]
/system/core/include/ion/
H A Dion.h29 int ion_close(int fd);
30 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask,
32 int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask,
34 int ion_sync_fd(int fd, int handle_fd);
35 int ion_free(int fd, struct ion_handle *handle);
36 int ion_map(int fd, struct ion_handle *handle, size_t length, int prot,
38 int ion_share(int fd, struct ion_handle *handle, int *share_fd);
39 int ion_import(int fd, int share_fd, struct ion_handle **handle);
/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);
H A Duio.h38 extern int readv( int fd, struct iovec* vecs, int count );
39 extern int writev( int fd, const struct iovec* vecs, int count );
/system/extras/tests/cpueater/
H A Dcpueater.c32 int fd; local
60 for (fd = 3; fd < 256; fd++) {
61 close(fd);
/system/extras/fatblock/
H A Dfdpool.c29 .fd = INVALID_FD,
79 pfd->fd = INVALID_FD;
85 close(pfd->fd);
97 static void fdpool_pool(struct pooled_fd *pfd, int fd) argument
103 pfd->fd = fd;
122 int fd; local
124 if (pfd->fd != INVALID_FD) {
126 return pfd->fd;
129 fd
[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);
H A Dlogo.c45 int fd; member in struct:FB
56 fb->fd = open("/dev/graphics/fb0", O_RDWR);
57 if (fb->fd < 0)
60 if (ioctl(fb->fd, FBIOGET_FSCREENINFO, &fb->fi) < 0)
62 if (ioctl(fb->fd, FBIOGET_VSCREENINFO, &fb->vi) < 0)
66 MAP_SHARED, fb->fd, 0);
73 close(fb->fd);
80 close(fb->fd);
87 ioctl(fb->fd, FBIOPUT_VSCREENINFO, &fb->vi);
89 ioctl(fb->fd, FBIOPUT_VSCREENINF
94 int fd, r; local
111 int fd; local
[all...]
/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/sync/
H A Dsync.h45 int sync_wait(int fd, int timeout);
47 struct sync_fence_info_data *sync_fence_info(int fd);
57 int sw_sync_timeline_inc(int fd, unsigned count);
58 int sw_sync_fence_create(int fd, const char *name, unsigned value);

Completed in 179 milliseconds

123456789