Skip to main content

Pure-Python bindings to glibc (based on ctypes)

Project description

Pure-Python bindings to glibc (based on ctypes)

.. image::

.. image::

.. image::


* Free software: LGPLv3 license
* Supports lots of glibc functions (see below), data types and constants.
* Supported on python 2.7+ and python 3.2+ and pypy
* All other useful glibc features are in scope (patches welcome!)
* ``from glibc import ...`` -- direct access to glibc functions and types via
lazy imports, fast startup, low memory overhead, efficient calls to glibc
* Declarative code, easy to verify for correctness, easy to add more types,
functions and constants.
* Translates error codes according to documentation (manual pages) of each
supported function. Raises OSError with appropriate values and a customized,
easy-to-understand error message.


The following glibc functions are supported

=========================== =================================
Name Remarks
=========================== =================================
``close(2)`` Same as os.close()
``dup(2)`` Same as os.dup()
``dup2(2)`` Same as os.dup2()
``dup3(2)`` Same as os.dup(flags=)
``epoll_create(2)`` Similar to select.epoll()
``epoll_create1(2)`` Similar to select.epoll()
``epoll_ctl(2)`` Similar to select.epoll.{register,unregister,modify}
``epoll_wait(2)`` Similar to select.epoll.poll()
``pipe(2)`` Same as os.pipe

0.5 (2014-10-22)

* Added tests for structure / union size and offset of each field
* New feature, type aliases for non-compound types like ``time_t``.
* Added functions: ``prctl(2)``, ``timerfd_create(2)``, ``timerfd_settime(2)``,
* Added constants: ``PR_SET_PDEATHSIG``, ``PR_GET_PDEATHSIG``,
* Added structures: ``struct itimerspec``, ``struct timespec`` and
``struct timeval``.
* Added type alias for ``time_t`` and ``suseconds_t``

0.4 (2014-10-21)

* Started tracking changes relevant to other people.
* First release with tests for constants and type sizes.
* Fixed issues with ``struct epoll_event`` (size mismatch).
* Added functions: ``close(2)``.
* Added constants: ``FD_SETSIZE``, ``EPOLLRDNORM``, ``EPOLLRDBAND``,
* Improved bundled demos (not part of release)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for glibc, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size glibc-0.5.tar.gz (85.0 kB) File type Source Python version None Upload date Hashes View
Filename, size glibc-0.5-py2.py3-none-any.whl (14.3 kB) File type Wheel Python version 2.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page