Thanks for your careful review, Bruno. I just now pushed some patches that I hope address most of your points, and will send out ten patch emails accordingly. The last one (patch 10/10) is the trickiest.
I followed most of your advice, with the following quibbles. > If the emulation uses sigprocmask, the module needs to depend on module > 'sigprocmask'. See doc/posix-functions/sigprocmask.texi. On further thought, the pselect emulation should use pthread_sigmask not sigprocmask, so I changed it to use that, and added a new pthread_sigmask module. > How did you test it? I built Emacs with it, and ran some test cases written in Emacs Lisp. Not exactly something that one can put into the gnulib tests.... but I added a gnulib unit test for pselect as you suggested. > No serial number here? I still don't get why hand-maintained serial numbers are useful in m4/*.m4 files (and nowhere else?!). Maybe they were useful long ago, but their cost outweighs their benefit now, as far as I can see.