[pypy-issue] [issue1166] Missing constants in kqueue implementation

Tobias Oberstein tracker at bugs.pypy.org
Sun Nov 10 22:39:12 CET 2013


Tobias Oberstein <tobias.oberstein at gmail.com> added the comment:

As for the platforms: kqueue was developed by Jonathan Lemon and first appeared
in FreeBSD 4.1. The OpenBSD and NetBSD implementations of kqueue are likely
derived of the FreeBSD one (but also slightly differ). The OSX kqueue is a
completely different implementation (since OSX is only a BSD personality OS with
a Mach microkernel under the hood. Completely different from BSD). The OSX
implementation in general lacks, has bugs - in short, it sucks.

Now the "API" exposed by CPython in the stdlib is patchy at best. The constants
exposed seem to be quite random, and in any case, just having a constant there
does not mean it will work on a specific kqueue-like platform.

FWIW, here is the FreeBSD manpage:
http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2

The whole OS interface consists of 2 syscalls ("kqueue" and "kevent"). The core
syscalls is done here:
https://bitbucket.org/pypy/pypy/src/b028e2cbd16b/pypy/module/select/interp_kqueue.py?at=default#cl-194

Now, given that above syscalls are wrapped in libc and the new C interface
"cffi" is maturing and quite awesome, I wonder why this low-level stuff
("pypy/module/select/interp_kqueue.py" is done in RPython) is needed anyway
anymore. Are there good reasons?

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1166>
________________________________________


More information about the pypy-issue mailing list