On Fri, Feb 7, 2025 at 2:36 PM Zhaoming Luo <zhming...@163.com> wrote: > Hi,
Hi, > Thread 4 hit Breakpoint 1, __GI___select (nfds=0, readfds=0x103cc20, > writefds=0x103cc40, exceptfds=0x103cc60, timeout=0x103cc84) > at ../sysdeps/mach/hurd/select.c:31 > ``` > > When I continue, it hangs at mach_msg[0]: > > gdb backtrace: > ``` > #0 0x011a206c in __GI___mach_msg_trap () at > ./build-tree/hurd-i386-libc/mach/mach_msg_trap.S:2 > #1 0x011a2800 in __GI___mach_msg (msg=0x103cad4, option=1282, send_size=0, > rcv_size=40, rcv_name=13, timeout=50000, notify=0) So, there is a timeout passed to select, and the same timeout was forwarded to mach_msg, it all seems to make sense? > If my comprehension is correct, nfds == 0 means that no descriptor needs > to be tested: > > From POSIX: > ``` > The nfds argument specifies the range of descriptors to be tested. The first > nfds descriptors shall be checked in each set; that is, the descriptors from > zero through nfds-1 in the descriptor sets shall be examined. > ``` > > So probably we should directly return from hurd_select when nfds == 0? "If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is not a null pointer, select() blocks for the time specified, or until interrupted by a signal. If the readfds, writefds, and errorfds arguments are all null pointers and the timeout argument is a null pointer, select() blocks until interrupted by a signal." Sergey