ostree/libglnx
Simon McVittie 803ac2144f New upstream version 2020.7 2020-10-14 12:56:10 +01:00
..
tests New upstream version 2020.4 2020-07-27 21:38:25 +01:00
COPYING New upstream version 2017.3 2017-03-10 23:16:34 +00:00
Makefile-libglnx.am New upstream version 2019.6 2019-12-14 10:47:26 +00:00
Makefile-libglnx.am.inc New upstream version 2019.6 2019-12-14 10:47:26 +00:00
README.md New upstream version 2020.4 2020-07-27 21:38:25 +01:00
glnx-backport-autocleanups.h New upstream version 2020.4 2020-07-27 21:38:25 +01:00
glnx-backport-autoptr.h Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
glnx-backports.c Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
glnx-backports.h New upstream version 2020.4 2020-07-27 21:38:25 +01:00
glnx-console.c New upstream version 2018.5+42+gecdebeb2 2018-06-08 09:11:07 +01:00
glnx-console.h New upstream version 2018.4 2018-03-24 18:19:31 +00:00
glnx-dirfd.c New upstream version 2017.13 2017-11-04 11:55:24 +00:00
glnx-dirfd.h New upstream version 2017.12 2017-10-03 18:51:37 +01:00
glnx-errors.c New upstream version 2017.15 2018-01-02 11:53:43 +00:00
glnx-errors.h New upstream version 2017.15 2018-01-02 11:53:43 +00:00
glnx-fdio.c New upstream version 2020.7 2020-10-14 12:56:10 +01:00
glnx-fdio.h New upstream version 2020.4 2020-07-27 21:38:25 +01:00
glnx-local-alloc.c Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
glnx-local-alloc.h New upstream version 2017.13 2017-11-04 11:55:24 +00:00
glnx-lockfile.c New upstream version 2017.13 2017-11-04 11:55:24 +00:00
glnx-lockfile.h New upstream version 2017.12 2017-10-03 18:51:37 +01:00
glnx-macros.h New upstream version 2019.6 2019-12-14 10:47:26 +00:00
glnx-missing-syscall.h New upstream version 2018.5 2018-05-15 11:05:08 +01:00
glnx-missing.h New upstream version 2019.6 2019-12-14 10:47:26 +00:00
glnx-shutil.c New upstream version 2019.1 2019-01-14 08:01:21 +00:00
glnx-shutil.h New upstream version 2017.6 2017-05-24 19:00:16 +01:00
glnx-xattrs.c New upstream version 2020.7 2020-10-14 12:56:10 +01:00
glnx-xattrs.h Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
libglnx.h New upstream version 2017.13 2017-11-04 11:55:24 +00:00
libglnx.m4 New upstream version 2020.4 2020-07-27 21:38:25 +01:00

README.md

libglnx is the successor to libgsystem.

It is for modules which depend on both GLib and Linux, intended to be used as a git submodule.

Features:

  • File APIs which use openat() like APIs, but also take a GCancellable to support dynamic cancellation
  • APIs also have a GError parameter
  • High level "shutil", somewhat inspired by Python's
  • A "console" API for tty output
  • A backport of the GLib cleanup macros for projects which can't yet take a dependency on 2.40.

Why?

There are multiple projects which have a hard dependency on Linux and GLib, such as NetworkManager, ostree, flatpak, etc. It makes sense for them to be able to share Linux-specific APIs.

This module also contains some code taken from systemd, which has very high quality LGPLv2+ shared library code, but most of the internal shared library is private, and not namespaced.

One could also compare this project to gnulib; the salient differences there are that at least some of this module is eventually destined for inclusion in GLib.

Adding this to your project

Meson

First, set up a Git submodule:

git submodule add https://gitlab.gnome.org/GNOME/libglnx subprojects/libglnx

Or a Git subtree:

git remote add libglnx https://gitlab.gnome.org/GNOME/libglnx.git
git fetch libglnx
git subtree add -P subprojects/libglnx libglnx/master

Then, in your top-level meson.build:

libglnx_dep = subproject('libglnx').get_variable('libglnx_dep')
# now use libglnx_dep in your dependencies

Porting from libgsystem

For all of the filesystem access code, libglnx exposes only fd-relative API, not GFile*. It does use GCancellable where applicable.

For local allocation macros, you should start using the g_auto macros from GLib. A backport is included in libglnx. There are a few APIs not defined in GLib yet, such as glnx_autofd.

gs_transfer_out_value is replaced by g_steal_pointer.

Contributing

Development happens in GNOME Gitlab: https://gitlab.gnome.org/GNOME/libglnx

(If you're seeing this on the Github mirror, we used to do development on Github but that was before GNOME deployed Gitlab.)