[issue12794] platform: add a function to get the system version as tuple

STINNER Victor report at bugs.python.org
Mon Aug 22 14:57:53 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> The whole purpose of autoconf/configure is
> to try to figure out which features are available on a platform
> and those features change with the OS version.

Hum, not exactly. autoconf checks if a function exists or if a constant exists in the C headers and in the C library. You have to check it or your program (C file) will not compile (missing function/constant).

But it's not enough. The GNU libc provides functions which are only available on some recent Linux kernels. Depending on the running kernel, the function may fail with something like "not implemented error".

See for example the discussion about accept4():
http://bugs.python.org/issue10115

At Python level, you need to know the running kernel version to check if accept4() if available or not. Knowing if the kernel used to compile Python has accept4() or not doesn't help.

(If you use the compiled Python on an older libc (e.g. on another computer), you have another problem, but it's the problem of OS vendors, not of Python.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12794>
_______________________________________


More information about the Python-bugs-list mailing list