Searched refs:fd (Results 26 - 50 of 218) sorted by path

123456789

/system/core/adb/
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...]
H A Dservices.c42 void (*func)(int fd, void *cookie);
43 int fd; member in struct:stinfo
51 sti->func(sti->fd, sti->cookie);
59 static void dns_service(int fd, void *cookie) argument
69 writex(fd, &zero, 4);
71 writex(fd, hp->h_addr, 4);
74 adb_close(fd);
83 int fd; local
85 fd = adb_creat("/tmp/update", 0644);
86 if(fd <
110 restart_root_service(int fd, void *cookie) argument
135 restart_tcp_service(int fd, void *cookie) argument
155 restart_usb_service(int fd, void *cookie) argument
165 reboot_service(int fd, void *arg) argument
341 subproc_waiter_service(int fd, void *cookie) argument
502 wait_for_state(int fd, void* cookie) argument
553 int fd = create_service_thread(wait_for_state, sinfo); local
[all...]
H A Dsockets.c33 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 Dsysdeps.h79 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 Dsysdeps_win32.c124 _fh_from_int( int fd )
128 fd -= WIN32_FH_BASE;
130 if (fd < 0 || fd >= _win32_fh_count) {
131 D( "_fh_from_int: invalid fd %d\n", fd + WIN32_FH_BASE );
136 f = &_win32_fhs[fd];
139 D( "_fh_from_int: invalid fd %d\n", fd + WIN32_FH_BASE );
357 D( "adb_open: '%s' => fd
402 adb_read(int fd, void* buf, int len) argument
414 adb_write(int fd, const void* buf, int len) argument
426 adb_lseek(int fd, int pos, int where) argument
438 adb_shutdown(int fd) argument
452 adb_close(int fd) argument
781 disable_tcp_nagle(int fd) argument
1339 int fd = _fh_to_int(f); local
1377 event_looper_hook( EventLooper looper, int fd, int events ) argument
1409 event_looper_unhook( EventLooper looper, int fd, int events ) argument
1748 int fd = fde->fd - WIN32_FH_BASE; local
1778 int fd = fde->fd - WIN32_FH_BASE; local
1829 fdevent_create(int fd, fd_func func, void *arg) argument
1847 fdevent_install(fdevent *fde, int fd, fd_func func, void *arg) argument
[all...]
H A Dtest_track_devices.c17 unix_write( int fd, const char* buf, int len ) argument
21 int len2 = write(fd, buf, len);
35 unix_read( int fd, char* buf, int len ) argument
39 int len2 = read(fd, buf, len);
H A Dtest_track_jdwp.c17 unix_write( int fd, const char* buf, int len ) argument
21 int len2 = write(fd, buf, len);
35 unix_read( int fd, char* buf, int len ) argument
39 int len2 = read(fd, buf, len);
H A Dtransport.c137 read_packet(int fd, const char* name, apacket** ppacket) argument
144 snprintf(buff, sizeof buff, "fd=%d", fd);
148 r = adb_read(fd, p, len);
153 D("%s: read_packet (fd=%d), error ret=%d errno=%d: %s\n", name, fd, r, errno, strerror(errno));
168 write_packet(int fd, const char* name, apacket** ppacket) argument
174 snprintf(buff, sizeof buff, "fd=%d", fd);
185 r = adb_write(fd,
198 transport_socket_events(int fd, unsigned events, void *_t) argument
523 transport_read_action(int fd, struct tmsg* m) argument
545 transport_write_action(int fd, struct tmsg* m) argument
1094 readx(int fd, void *ptr, size_t len) argument
1126 writex(int fd, const void *ptr, size_t len) argument
[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 Dtransport_local.c112 int fd = -1; local
117 fd = socket_network_client(host, adb_port, SOCK_STREAM);
120 if (fd < 0) {
121 fd = socket_loopback_client(adb_port, SOCK_STREAM);
124 if (fd >= 0) {
125 D("client: connected on remote on fd %d\n", fd);
126 close_on_exec(fd);
127 disable_tcp_nagle(fd);
129 register_socket_transport(fd, bu
156 int serverfd, fd; local
242 int res, fd; local
334 int fd = t->sfd; local
[all...]
H A Dusb_linux.c139 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...]
H A Dusb_linux_client.c50 int fd; member in struct:usb_handle
152 int fd; local
157 while (usb->fd != -1)
164 fd = unix_open("/dev/android_adb", O_RDWR);
165 if (fd < 0) {
167 fd = unix_open("/dev/android", O_RDWR);
169 if (fd < 0) {
172 } while (fd < 0);
175 close_on_exec(fd);
176 usb->fd
232 int fd; local
[all...]
/system/core/charger/
H A Dcharger.c247 int fd; local
250 fd = open(path, O_RDONLY, 0);
251 if (fd < 0)
254 cnt = read(fd, buf, sz - 1);
263 close(fd);
267 if (fd >= 0)
268 close(fd);
488 static int handle_uevent_fd(struct charger *charger, int fd) argument
493 if (fd < 0)
499 n = uevent_kernel_multicast_recv(fd, ms
515 uevent_callback(int fd, short revents, void *data) argument
530 int dfd, fd; local
894 input_callback(int fd, short revents, void *data) argument
932 int fd; local
[all...]
/system/core/cpio/
H A Dmkbootfs.c237 int fd; local
239 fd = open(in, O_RDONLY);
240 if(fd < 0) die("cannot open '%s' for read", in);
245 if(read(fd, tmp, s.st_size) != s.st_size) {
252 close(fd);
/system/core/debuggerd/
H A Dbacktrace.c115 void dump_backtrace(int fd, pid_t pid, pid_t tid, bool* detach_failed, argument
118 log.tfd = fd;
H A Dbacktrace.h28 void dump_backtrace(int fd, pid_t pid, pid_t tid, bool* detach_failed,
H A Ddebuggerd.c61 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...]
H A Dgetevent.c22 int fd; local
30 fd = open(device, O_RDWR);
31 if(fd < 0) {
35 if(ioctl(fd, EVIOCGVERSION, &version)) {
38 if(ioctl(fd, EVIOCGID, &id)) {
44 if(ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) {
48 if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
52 if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
69 ufds[nfds].fd = fd;
[all...]
H A Dtombstone.c644 static char* find_and_open_tombstone(int* fd) argument
674 *fd = open(path, O_CREAT | O_EXCL | O_WRONLY, 0600);
675 if (*fd < 0)
678 fchown(*fd, AID_SYSTEM, AID_SYSTEM);
684 *fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
685 if (*fd < 0) {
689 fchown(*fd, AID_SYSTEM, AID_SYSTEM);
706 int fd; local
707 char* path = find_and_open_tombstone(&fd);
714 log.tfd = fd;
[all...]
/system/core/fastboot/
H A Dengine.c232 static void *load_buffer(int fd, off_t size) argument
247 lseek(fd, 0, SEEK_SET);
249 ssize_t actually_read = read(fd, (char*)buffer+count, size-count);
266 buffer = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
287 int fd; local
300 fd = open(filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0644);
303 fd = fileno(tmpfile());
308 make_ext4fs_internal(fd, NULL, NULL, NULL, 0, 1, 0, 0, 0, NULL);
310 fstat(fd, &st);
312 image->buffer = load_buffer(fd, s
324 int fd; local
[all...]
H A Dfastboot.c144 int fd; local
146 fd = open(fn, O_RDONLY);
147 if (fd < 0) return -1;
149 off = lseek64(fd, 0, SEEK_END);
150 close(fd);
159 int fd; local
163 fd = open(fn, O_RDONLY);
164 if(fd < 0) return 0;
166 sz = lseek(fd, 0, SEEK_END);
169 if(lseek(fd,
492 int fd; local
[all...]
H A Dusb_linux.c98 static int filter_usb_device(int fd, char *ptr, int len, int writable, argument
153 result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
165 * hub. We are passed an fd that was obtained by opening an entry under
183 result = fstat(fd, &st);
253 int fd; local
274 if((fd = open(devname, O_RDWR)) < 0) {
278 if((fd = open(devname, O_RDONLY)) < 0) {
283 n = read(fd, desc, sizeof(desc));
285 if(filter_usb_device(fd, desc, n, writable, callback,
291 usb->desc = fd;
408 int fd; local
420 int fd; local
[all...]
/system/core/gpttool/
H A Dgpttool.c89 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/include/cutils/
H A Dabort_socket.h38 * asocket_create() sets the fd to non-blocking mode. It must not be changed to
59 int fd; /* primary socket fd */ member in struct:asocket
63 /* Create an asocket from fd.
67 struct asocket *asocket_init(int fd);
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);

Completed in 79 milliseconds

123456789