• Home
  • Raw
  • Download

Lines Matching refs:fd

209 fd_read(int  fd, void*  to, int  len)  in fd_read()  argument
214 ret = read(fd, to, len); in fd_read()
221 fd_write(int fd, const void* from, int len) in fd_write() argument
226 ret = write(fd, from, len); in fd_write()
233 fd_setnonblock(int fd) in fd_setnonblock() argument
238 flags = fcntl(fd, F_GETFD); in fd_setnonblock()
243 __FUNCTION__, fd, strerror(errno) ); in fd_setnonblock()
247 ret = fcntl(fd, F_SETFD, flags | O_NONBLOCK); in fd_setnonblock()
252 __FUNCTION__, fd, strerror(errno) ); in fd_setnonblock()
258 fd_accept(int fd) in fd_accept() argument
265 ret = accept(fd, &from, &fromlen); in fd_accept()
324 int fd; member
370 looper_find( Looper* l, int fd ) in looper_find() argument
376 if (hook->fd == fd) in looper_find()
401 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev ); in looper_grow()
409 looper_add( Looper* l, int fd, EventFunc func, void* user ) in looper_add() argument
419 hook->fd = fd; in looper_add()
426 fd_setnonblock(fd); in looper_add()
430 epoll_ctl( l->epoll_fd, EPOLL_CTL_ADD, fd, &ev ); in looper_add()
438 looper_del( Looper* l, int fd ) in looper_del() argument
440 LoopHook* hook = looper_find( l, fd ); in looper_del()
443 D( "%s: invalid fd: %d", __FUNCTION__, fd ); in looper_del()
449 epoll_ctl( l->epoll_fd, EPOLL_CTL_DEL, fd, NULL ); in looper_del()
457 looper_enable( Looper* l, int fd, int events ) in looper_enable() argument
459 LoopHook* hook = looper_find( l, fd ); in looper_enable()
462 D("%s: invalid fd: %d", __FUNCTION__, fd ); in looper_enable()
473 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, fd, &ev ); in looper_enable()
482 looper_disable( Looper* l, int fd, int events ) in looper_disable() argument
484 LoopHook* hook = looper_find( l, fd ); in looper_disable()
487 D("%s: invalid fd: %d", __FUNCTION__, fd ); in looper_disable()
498 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, fd, &ev ); in looper_disable()
557 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev ); in looper_loop()
750 int fd; member
840 if (f->fd >= 0) { in fdhandler_close()
841 looper_del( f->list->looper, f->fd ); in fdhandler_close()
842 close(f->fd); in fdhandler_close()
843 f->fd = -1; in fdhandler_close()
888 looper_enable( f->list->looper, f->fd, EPOLLOUT ); in fdhandler_enqueue()
910 if ((len = fd_read(f->fd, p->data, MAX_PAYLOAD)) < 0) { in fdhandler_event()
922 D("%s: disconnect on fd %d", __FUNCTION__, f->fd); in fdhandler_event()
932 if ((len = fd_write(f->fd, p->data + f->out_pos, avail)) < 0) { in fdhandler_event()
942 looper_disable( f->list->looper, f->fd, EPOLLOUT ); in fdhandler_event()
952 fdhandler_new( int fd, in fdhandler_new() argument
958 f->fd = fd; in fdhandler_new()
967 looper_add( list->looper, fd, (EventFunc) fdhandler_event, f ); in fdhandler_new()
968 looper_enable( list->looper, fd, EPOLLIN ); in fdhandler_new()
985 D("%s: accepting on fd %d", __FUNCTION__, f->fd); in fdhandler_accept_event()
988 p->channel = fd_accept(f->fd); in fdhandler_accept_event()
999 D("%s: closing accept fd %d", __FUNCTION__, f->fd); in fdhandler_accept_event()
1011 fdhandler_new_accept( int fd, in fdhandler_new_accept() argument
1017 f->fd = fd; in fdhandler_new_accept()
1023 looper_add( list->looper, fd, (EventFunc) fdhandler_accept_event, f ); in fdhandler_new_accept()
1024 looper_enable( list->looper, fd, EPOLLIN ); in fdhandler_new_accept()
1025 listen( fd, 5 ); in fdhandler_new_accept()
1185 int fd, in serial_init() argument
1197 s->fdhandler = fdhandler_new( fd, list, &recv ); in serial_init()
1253 funcname, c, c->fdhandler->fd, in client_dump()
1329 T("%s: client %p (%d)", __FUNCTION__, c, c->fdhandler->fd); in client_fd_close()
1384 int fd, in client_new() argument
1403 c->fdhandler = fdhandler_new( fd, pfdhandlers, &recv ); in client_new()
1598 int fd = p->channel; in multiplexer_control_accept() local
1599 Client* client = client_new( m, fd, m->fdhandlers, &m->clients ); in multiplexer_control_accept()
1601 D("created client %p listening on fd %d", client, fd); in multiplexer_control_accept()
1616 int fd, control_fd; in multiplexer_init() local
1625 fd = open(serial_dev, O_RDWR); in multiplexer_init()
1626 } while (fd < 0 && errno == EINTR); in multiplexer_init()
1628 if (fd < 0) { in multiplexer_init()
1635 tcgetattr( fd, &ios ); in multiplexer_init()
1637 tcsetattr( fd, TCSANOW, &ios ); in multiplexer_init()
1645 serial_init( m->serial, fd, m->fdhandlers, &recv ); in multiplexer_init()
1652 fd = android_get_control_socket(CONTROL_SOCKET_NAME); in multiplexer_init()
1653 if (fd < 0) { in multiplexer_init()
1657 fdhandler_new_accept( fd, m->fdhandlers, &recv ); in multiplexer_init()
1679 int fd, len; in main() local
1683 fd = open( "/proc/cmdline", O_RDONLY ); in main()
1684 if (fd < 0) { in main()
1690 len = fd_read( fd, buff, sizeof(buff)-1 ); in main()
1691 close(fd); in main()