Re:All about Linux signals - Linux Programming Blog
by krakensden on Tuesday April 03, 2012 @01:12PM
(#3793822)
I understand that signalfd() is unportable, the question is, why port?
Re:All about Linux signals - Linux Programming Blog
by calloc on Tuesday April 03, 2012 @06:29PM
(#3795126)
Many people do still want to run FreeBSD, and it may not be you the original developer that has to port it, but the ports maintainer that puts it in the FreeBSD ports tree, or a company that already has everything running on top of FreeBSD (think Yahoo) wants to use the software, now they have to take the time to port your Linux only code, when using standard POSIX compliant code would have made it much simpler, possibly as simple as a ./configure && make rather than introducing extra work.
Why limit your audience to one single operating system?
Yes, signalfd() is wonderful and nice, but it makes it a pain in the behind to port your software. If you need to use signals and do it in an event loop of some sort take a look at libev which abstracts away the OS and handles it in the best way possible depending on the system it is run on.
Not only that, but libev will make use of epoll/kqueue/select/poll as required on the OS it is running on, so you get easier portability with the various different event mechanisms that do exist across systems.