Page MenuHomeFreeBSD

Implement epoll family system calls. This is a tiny wrapper around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata.
ClosedPublic

Authored by dchagin on Nov 3 2014, 8:31 AM.

Details

Summary

Initial patch developed by rdivacky@ in 2007, then extended
by Yuri Victorovich @ r255672 and finished by me
in collaboration with mjg@.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dchagin retitled this revision from to Implement epoll family system calls. This is a tiny wrapper around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata..
dchagin updated this object.

I hadn't reviewed the code yet, but had you considered implementing epoll() for FreeBSD binaries and then adding a Linux wrapper, like you did with eg. ppoll? In the long run this should make life a lot easier for ports folks. The ppoll() implementation already helped me with pesign port :-)

In D1092#3, @trasz wrote:

I hadn't reviewed the code yet, but had you considered implementing epoll() for FreeBSD binaries and then adding a Linux wrapper, like you did with eg. ppoll? In the long run this should make life a lot easier for ports folks. The ppoll() implementation already helped me with pesign port :-)

Interesting thought. We should get this in first in my opinion, and evaluate a native epoll as a separate later item.

Okay, it can be easily done later.

native epoll? what the reason for? we have kevent

It's because of porting - the more Linux APIs we implement, the less work it takes to port software written for Linux to FreeBSD.

Check that user supplied epfd file descriptor is a kqueue file descriptor
a bit earlier as in epoll_to_kevent() we use epoll.
Reported by: trinity

I can't accept this revision myself, but I can put my hands up in celebration as a comment

\o/

Thanks for all your hard work getting this together and landed Dmitry :)

This revision was automatically updated to reflect the committed changes.