Code Monkey home page Code Monkey logo

libglnx's Introduction

libglnx is the successor to libgsystem: https://git.gnome.org/browse/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
  • Some basic container utility functions
  • 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, xdg-app, 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.

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_fd_close.

gs_transfer_out_value is replaced by g_steal_pointer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.