Closed bsbernd closed 9 months ago
@ming1 Just wanted to check how to use polling on the ring fd and noticed that q->efd was assumed to be never 0.
Result of eventfd() might be zero - this is a valid file descriptor.
file descriptor 0 is reserved for standard input, so it shouldn't be returned from eventfd().
Do you see any problem with current way of treating zero as failure?
Thanks,
I was just looking something up in the code, without using it. It is ensured that stdin is still open when eventfd is set up, in all cases? Just very unusual to treat fd=0 as special...
I was just looking something up in the code, without using it. It is ensured that stdin is still open when eventfd is set up, in all cases? Just very unusual to treat fd=0 as special...
Fair enough, merged.
thanks,
Result of eventfd() might be zero - this is a valid file descriptor.
Also always return -errno (and 0) from ublksrv_setup_eventfd() and use it for the error message.