/system/extras/tests/directiotest/ |
H A D | directiotest.c | 70 static ssize_t do_read(int fd, void *buf, off64_t start, size_t count) argument 75 lseek64(fd, start, SEEK_SET); 78 ret = read(fd, (char *)buf + bytes_read, count - bytes_read); 92 static ssize_t do_write(int fd, const void *buf, off64_t start, size_t count) argument 97 lseek64(fd, start, SEEK_SET); 100 ret = write(fd, (char *)buf + bytes_out, count - bytes_out); 173 int fd; local 187 fd = open(path, O_RDWR | O_DIRECT | O_LARGEFILE); 188 if (fd == -1) { 192 if (fstat(fd, [all...] |
/system/extras/tests/framebuffer/ |
H A D | fb_test.c | 54 int fd; local 58 fd = open("/dev/graphics/fb0", O_RDWR); 59 if (fd < 0) { 61 if ((fd = open("/dev/fb0", O_RDWR)) < 0) { 67 if(ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) { 75 if(ioctl(fd, FBIOPUT_VSCREENINFO, &vi) < 0) { 81 if(ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) { 88 bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 111 return fd; 141 int fd local [all...] |
H A D | mdp_test.c | 31 static int open_file(char *name, int *fd, int *len, int *fmt) argument 51 *fd = open(fn, O_RDONLY); 52 if (*fd < 0) { 57 if (fstat(*fd, &stat) < 0) { 64 printf("Successfully opened file %s (fmt=%d len=%d fd=%d)\n", fn, *fmt, 65 *len, *fd); 69 close(*fd); 73 static int get_pmem(int *fd, void **data, int sz) argument 75 *fd = open("/dev/pmem", O_RDWR | O_NONBLOCK | O_SYNC); 76 if (*fd < 95 get_framebuffer(int *fd, char **fb, int *width, int *height) argument 128 set_active_framebuffer(int fd, unsigned n) argument [all...] |
/system/extras/tests/iptables/qtaguid/ |
H A D | socketTag.cpp | 41 SockInfo() : fd(-1), addr(NULL) {}; 44 int fd; member in class:android::SockInfo 98 fd = socket(AF_INET, SOCK_STREAM, 0); 99 if (fd < 0) { 103 if (doCtrlCommand("t %d %llu", fd, tag) < 0) { 105 close(fd); 110 close(fd); 113 if (doCtrlCommand("u %d", fd) < 0) { 115 close(fd); 262 EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, ta [all...] |
/system/extras/tests/sdcard/ |
H A D | sdcard_perf_test.cpp | 88 #define FADVISE(fd, off, len, advice) (void)0 297 int fd = open(filename, O_RDONLY); local 300 if (fd < 0) 305 FADVISE(fd, 0, 0, testCase->fadvise()); 327 ssize_t s = read(fd, dest, chunk_size); 331 close(fd); 339 close(fd); 376 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local 385 ssize_t written = write(fd, chunk, chunk_size); 393 close(fd); 423 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); // no O_TRUNC, see header comment local 542 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local 560 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local [all...] |
H A D | sysutil.cpp | 84 int fd = open(filename, O_RDONLY); local 86 if (fd < 0) 105 s = read(fd, end, size); 127 close(fd); 148 int fd = open(filename, O_WRONLY); local 151 if (fd < 0) 167 ssize_t s = write(fd, start, size); 184 close(fd); 399 void fsyncAndDropCaches(int fd, int code) argument 401 fsync(fd); [all...] |
/system/netd/ |
H A D | TetherController.cpp | 66 int fd = open("/proc/sys/net/ipv4/ip_forward", O_WRONLY); local 67 if (fd < 0) { 72 if (write(fd, (enable ? "1" : "0"), 1) != 1) { 74 close(fd); 77 close(fd); 82 int fd = open("/proc/sys/net/ipv4/ip_forward", O_RDONLY); local 84 if (fd < 0) { 90 if (read(fd, &enabled, 1) != 1) { 92 close(fd); 96 close(fd); [all...] |
/system/core/adb/ |
H A D | fdevent.c | 73 fprintf(stderr,"FDE #%03d %c%c%c %s\n", fde->fd, 95 static void fdevent_subproc_event_func(int fd, unsigned events, void *userdata); 135 if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fde->fd, &ev)) { 155 epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fde->fd, &ev); 181 if(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fde->fd, &ev)) { 186 if(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fde->fd, &ev)) { 196 if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fde->fd, &ev)) { 262 if(fde->fd >= select_n) { 263 select_n = fde->fd + 1; 271 FD_CLR(fde->fd, 517 fdevent_subproc_event_func(int fd, unsigned ev, void *userdata) argument 575 fdevent_create(int fd, fd_func func, void *arg) argument 593 fdevent_install(fdevent *fde, int fd, fd_func func, void *arg) argument [all...] |
H A D | jdwp_service.c | 317 int fd = proc->out_fds[0]; local 340 ((int*)CMSG_DATA(cmsg))[0] = fd; 360 adb_close(fd); 371 fd, proc->pid);
|
H A D | sockets.c | 33 int sendfailmsg(int fd, const char *reason) argument 40 if(writex(fd, buf, 8)) return -1; 41 return writex(fd, reason, len); 55 ** write to their fd. 148 int r = adb_write(s->fd, p->ptr, p->len); 204 D("LS(%d): destroying fde.fd=%d\n", s->id, s->fde.fd); 206 /* IMPORTANT: the remove closes the fd 229 D("entered. LS(%d) fd=%d\n", s->id, s->fd); 263 local_socket_event_func(int fd, unsigned ev, void *_s) argument 393 create_local_socket(int fd) argument 413 int fd; local [all...] |
H A D | file_sync_client.c | 65 void sync_quit(int fd) argument 72 writex(fd, &msg.req, sizeof(msg.req)); 77 int sync_ls(int fd, const char *path, sync_ls_cb func, void *cookie) argument 89 if(writex(fd, &msg.req, sizeof(msg.req)) || 90 writex(fd, path, len)) { 95 if(readx(fd, &msg.dent, sizeof(msg.dent))) break; 102 if(readx(fd, buf, len)) break; 112 adb_close(fd); 126 int sync_readtime(int fd, const char *path, unsigned *timestamp) argument 134 if(writex(fd, 151 sync_start_readtime(int fd, const char *path) argument 167 sync_finish_readtime(int fd, unsigned int *timestamp, unsigned int *mode, unsigned int *size) argument 185 sync_readmode(int fd, const char *path, unsigned *mode) argument 210 write_data_file(int fd, const char *path, syncsendbuf *sbuf) argument 247 write_data_buffer(int fd, char* file_buffer, int size, syncsendbuf *sbuf) argument 273 write_data_link(int fd, const char *path, syncsendbuf *sbuf) argument 297 sync_send(int fd, const char *lpath, const char *rpath, unsigned mtime, mode_t mode, int verifyApk) argument 441 sync_recv(int fd, const char *rpath, const char *lpath) argument 543 int fd = adb_connect("sync:"); local 674 copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps, int listonly) argument 746 int fd; local 871 copy_remote_dir_local(int fd, const char *rpath, const char *lpath, int checktimestamps) argument 948 int fd; local 1010 int fd = adb_connect("sync:"); local [all...] |
H A D | sysdeps.h | 79 static __inline__ void close_on_exec(int fd) argument 84 extern void disable_tcp_nagle(int fd); 115 extern int adb_read(int fd, void* buf, int len); 116 extern int adb_write(int fd, const void* buf, int len); 117 extern int adb_lseek(int fd, int pos, int where); 118 extern int adb_shutdown(int fd); 119 extern int adb_close(int fd); 121 static __inline__ int unix_close(int fd) argument 123 return close(fd); 128 static __inline__ int unix_read(int fd, voi argument 135 unix_write(int fd, const void* buf, size_t len) argument 199 int fd; member in struct:fdevent 219 adb_socket_setbufsize( int fd, int bufsize ) argument 304 close_on_exec(int fd) argument 334 int fd = open( pathname, options ); local 343 adb_shutdown(int fd) argument 350 adb_close(int fd) argument 358 adb_read(int fd, void* buf, size_t len) argument 366 adb_write(int fd, const void* buf, size_t len) argument 373 adb_lseek(int fd, int pos, int where) argument 389 int fd = creat(path, mode); local 402 int fd; local 432 adb_socket_setbufsize( int fd, int bufsize ) argument 438 disable_tcp_nagle(int fd) argument [all...] |
H A D | usb_linux.c | 139 int fd ; local 173 if((fd = unix_open(devname, O_RDONLY)) < 0) { 177 desclength = adb_read(fd, devdesc, sizeof(devdesc)); 183 adb_close(fd); 191 adb_close(fd); 204 adb_close(fd); 273 if (!fstat(fd, &st) && S_ISCHR(st.st_mode)) { 300 adb_close(fd); 483 D("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname); 510 D("[ kicking %p (fd [all...] |
/system/core/debuggerd/ |
H A D | debuggerd.c | 61 int fd; local 63 fd = open(file, O_RDWR); 65 if (fd < 0) 67 amt = write(fd, string, len); 68 close(fd); 187 static int read_request(int fd, debugger_request_t* out_request) { argument 190 int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len); 197 fcntl(fd, F_SETFL, O_NONBLOCK); 200 pollfds[0].fd = fd; 264 handle_request(int fd) argument 458 int fd; local [all...] |
/system/core/gpttool/ |
H A D | gpttool.c | 89 int fd; local 90 fd = open("/dev/urandom", O_RDONLY); 91 read(fd, uuid, 16); 92 close(fd); 260 int fd; local 291 fd = open(device, O_RDWR); 292 if (fd < 0) { 296 if (ioctl(fd, BLKGETSIZE64, &sz)) { 367 write(fd, &ptbl, sizeof(ptbl)); 368 fsync(fd); [all...] |
/system/core/init/ |
H A D | bootchart.c | 50 unix_read(int fd, void* buff, int len) argument 53 do { ret = read(fd, buff, len); } while (ret < 0 && errno == EINTR); 58 unix_write(int fd, const void* buff, int len) argument 61 do { ret = write(fd, buff, len); } while (ret < 0 && errno == EINTR); 69 int fd = open(filename, O_RDONLY); local 70 if (fd >= 0) { 71 len = unix_read(fd, buff, buffsize-1); 72 close(fd); 82 int fd; member in struct:__anon367 90 buff->fd 161 close_on_exec(int fd) argument 188 int fd, ret, len; local 217 int fd; local 258 int fd; local 342 int fd = open( LOG_ACCT, O_WRONLY|O_CREAT|O_TRUNC,0644); local [all...] |
H A D | property_service.c | 117 int fd; member in struct:__anon374 123 int fd; local 128 fd = open("/dev/__properties__", O_RDWR | O_CREAT, 0600); 129 if (fd < 0) 132 if (ftruncate(fd, size) < 0) 135 data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 139 close(fd); 141 fd = open("/dev/__properties__", O_RDONLY); 142 if (fd < 0) 149 w->fd 325 int fd, length; local 484 get_property_workspace(int *fd, int *sz) argument 536 int fd, length; local 609 int fd; local [all...] |
H A D | util.c | 91 int fd, ret; local 96 fd = socket(PF_UNIX, type, 0); 97 if (fd < 0) { 122 ret = bind(fd, (struct sockaddr *) &addr, sizeof (addr)); 139 return fd; 144 close(fd); 153 int fd; local 157 fd = open(fn, O_RDONLY); 158 if(fd < 0) return 0; 162 if (fstat(fd, 203 int fd; local 374 int fd; local 396 int fd, n; local 442 int fd; local [all...] |
/system/core/sh/ |
H A D | nodes.h | 105 int fd; member in struct:nfile 114 int fd; member in struct:ndup 123 int fd; member in struct:nhere
|
/system/extras/atrace/ |
H A D | atrace.c | 110 int fd = open(filename, O_WRONLY); local 111 if (fd == -1) { 119 if (write(fd, str, len) != len) { 125 close(fd);
|
/system/extras/ext4_utils/ |
H A D | ext4_utils.h | 50 int fd, off64_t offset) 52 return __mmap2(addr, length, prot, flags, fd, offset >> 12); 158 void write_ext4_image(int fd, int gz, int sparse, int crc); 166 u64 get_file_size(int fd); 49 mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) argument
|
H A D | make_ext4fs.c | 307 int fd; local 313 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); 314 if (fd < 0) { 319 status = make_ext4fs_internal(fd, NULL, mountpoint, NULL, 0, 0, 0, 1, 0, sehnd); 320 close(fd); 325 int make_ext4fs_internal(int fd, const char *directory, argument 336 info.len = get_file_size(fd); 467 wipe_block_device(fd, info.len); 469 write_ext4_image(fd, gzip, sparse, crc);
|
/system/bluetooth/brcm_patchram_plus/ |
H A D | brcm_patchram_plus.c | 569 read_event(int fd, uchar *buffer) argument 575 while ((count = read(fd, &buffer[i], len)) < len) { 583 while ((count = read(fd, &buffer[i], len)) < len) { 744 int fd; local 756 fd = open(path, O_RDONLY); 757 if (fd < 0) { 763 sz = read(fd, bdaddr, len); 767 close(fd); 771 close(fd);
|
/system/bluetooth/tools/ |
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 | 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...] |