That's fine, except that compiling your library on a machine that has epoll, and then trying to run it on a machine without will not work. It will not load if runtime glibc doesn't have epoll. I'm using "syscall" to work around that problem in wine.
Why not use dlopen?