udevd move from select() to ppoll()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm writing as I recently encountered a regression after the select()
--> ppoll() move in the udevd daemon, running on uClibc-0.9.29 and at
least kernels since 2.6.28.

For some reason the ppoll call always returns -1 w/ EINVAL in this
configuration. I actually anticipate this to be a bug in either Linux or
uClibc...

However, while investigating this, I came across the following sequence
of steps performed in udevd.c (line 973):

fdcount = ppoll(pfd, nfds, NULL, &orig_mask);
sigprocmask(SIG_SETMASK, &orig_mask, NULL);

Maybe I am missing something, but my reading of the man page indicates
that the following sequence would accomplish the same work, but would be
faster, as it eliminates the restoration of blocked_mask at the end of
the ppoll() call, which then proceeds to be overwritten again to what it
was inside ppoll by the above sigprocmask() call.

Would it be basically the same to do the following (but faster)?

sigprocmask(SIG_SETMASK, &orig_mask, NULL);
fdcount = poll(pfd, nfds, -1);

Additionally, this reportedly fixes the EINVAL that is hit in uClibc
too, which doesn't reach the error condition in poll().

-- 
Coleman Kane

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux