libev featured fifo

Marc Lehmann schmorp at schmorp.de
Wed May 18 06:34:03 CEST 2016


On Wed, May 18, 2016 at 02:29:14AM +0200, Robert Eisele <robert at xarg.org> wrote:
> directly accepting 0 byte reads after the first byte was read. Is this a
> problem with libev or am I missing something?

That's likely a problem with your code forgetting to close the fifo?

> epoll_wait(3, {{EPOLLHUP, {u32=5, u64=4294967301}}}, 64, 59743) = 1
> epoll_ctl(3, EPOLL_CTL_MOD, 5, {EPOLLIN, {u32=5, u64=4294967301}}) = 0
> clock_gettime(CLOCK_MONOTONIC, {43720, 29238758}) = 0
> read(5, "", 130)                        = 0
> 
> I'd like to put the process asleep again when everything was read. Is
> there a way to accomplish that?

Unregister the I/O watcher, close the socket.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list