/system/core/adb/ |
H A D | console.c | 8 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 D | usb_linux_client.c | 35 int fd; member in struct:usb_handle 48 int fd; local 53 while (usb->fd != -1) 60 fd = unix_open("/dev/android_adb", O_RDWR); 61 if (fd < 0) { 63 fd = unix_open("/dev/android", O_RDWR); 65 if (fd < 0) { 68 } while (fd < 0); 71 close_on_exec(fd); 72 usb->fd 115 int fd; local [all...] |
H A D | remount_service.c | 36 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...] |
H A D | adb_client.c | 86 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 211 int fd = _adb_connect("host:version"); local 279 int fd = adb_connect(service); local 299 int fd = adb_connect(service); local [all...] |
H A D | file_sync_service.c | 155 int fd; local 157 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 158 if(fd < 0 && errno == ENOENT) { 160 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 162 if(fd < 0 && errno == EEXIST) { 163 fd = adb_open_mode(path, O_WRONLY, mode); 165 if(fd < 0) { 168 fd = -1; 193 if(fd < 0) 195 if(writex(fd, buffe 320 int fd, r; local 357 file_sync_service(int fd, void *cookie) argument [all...] |
/system/core/libcutils/ |
H A D | load_file.c | 26 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 D | ashmem-dev.c | 44 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 D | ashmem-host.c | 42 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 D | pipetest.c | 37 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 D | socktest.c | 51 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 D | asocket_test.c | 52 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 D | sock_shutdown_bug_l2cap.c | 27 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 D | sock_shutdown_bug_tcp.c | 26 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 D | sock_shutdown_bug_rfcomm.c | 28 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);
|
H A D | sock_shutdown_test.c | 50 int fd; member in struct:thread_args 109 static int _close(int fd) { argument 112 printf("%d: close(%d)\n", gettid(), fd); 113 ret = close(fd); 114 printf("%d: close(%d) = %d\n", gettid(), fd, ret); 120 static int _bind(int fd, int type) { argument 149 printf("%d: bind(%d)\n", gettid(), fd); 150 ret = bind(fd, addr, len); 151 printf("%d: bind(%d) = %d\n", gettid(), fd, ret); 157 static int _listen(int fd, in argument 168 _accept(int fd, int type) argument 207 _shutdown(int fd, int how) argument 226 int fd; local [all...] |
/system/core/include/cutils/ |
H A D | ashmem.h | 20 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 D | uio.h | 38 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 D | cpueater.c | 32 int fd; local 60 for (fd = 3; fd < 256; fd++) { 61 close(fd);
|
/system/core/toolbox/ |
H A D | smd.c | 9 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);
|
H A D | setconsole.c | 14 int fd = (int)arg; local 17 res = ioctl(fd, VT_ACTIVATE, (void*)activate_thread_switch_vc); 32 int fd; local 102 fd = open(ttydev, O_RDWR | O_SYNC); 103 if (fd < 0) { 111 res = ioctl(fd, VT_GETSTATE, &vs); 120 res = ioctl(fd, VT_OPENQRY, &vtnum); 132 pthread_create(&thread, &attr, activate_thread, (void*)fd); 135 res = ioctl(fd, VT_WAITACTIVE, (void*)switch_vc); 144 close(fd); [all...] |
/system/netd/ |
H A D | UsbController.cpp | 49 int fd = open("/sys/class/usb_composite/rndis/enable", O_RDWR); local 51 write(fd, value, count); 52 close(fd); 58 int fd = open("/sys/class/usb_composite/rndis/enable", O_RDWR); local 59 read(fd, &value, 1); 60 close(fd);
|
H A D | main.cpp | 82 int dfd, fd; local 86 fd = openat(dfd, "uevent", O_WRONLY); 87 if(fd >= 0) { 88 write(fd, "add\n", 4); 89 close(fd); 101 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY); 102 if(fd < 0) 105 d2 = fdopendir(fd); 107 close(fd);
|
/system/core/init/ |
H A D | logo.c | 45 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/vold/ |
H A D | Devmapper.cpp | 53 int fd; local 54 if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) { 64 if (ioctl(fd, DM_LIST_DEVICES, io)) { 68 close(fd); 76 close(fd); 87 if (ioctl(fd, DM_DEV_STATUS, io2)) { 109 close(fd); 134 int fd; local 135 if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) { 144 if (ioctl(fd, DM_DEV_STATU 168 int fd; local 263 int fd; local [all...] |
/system/bluetooth/bluedroid/ |
H A D | bluetooth.c | 52 int fd; local 57 fd = open(path, O_RDONLY); 58 if (fd < 0) { 62 sz = read(fd, &buf, sizeof(buf)); 63 close(fd); 76 int fd = -1; local 84 fd = open(rfkill_state_path, O_RDONLY); 85 if (fd < 0) { 90 sz = read(fd, &buffer, 1); 107 if (fd > 113 int fd = -1; local [all...] |