All Projects → lovell → detect-libc

lovell / detect-libc

Licence: Apache-2.0 license
Node.js module to detect details of the C standard library (libc) implementation provided by a given Linux system

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to detect-libc

khadas-openwrt
openwrt for Khadas boards
Stars: ✭ 25 (-24.24%)
Mutual labels:  musl
musl-wiki
A community-maintained wiki documenting the musl libc.
Stars: ✭ 61 (+84.85%)
Mutual labels:  musl
libc-db
libc database (file in packages, hash, package files, symbols). Raw binary libc available on https://github.com/BestPig/libc-bin)
Stars: ✭ 21 (-36.36%)
Mutual labels:  libc
platform bionic
Hardened Android standard C library. Some of the past hardening has not yet been ported from Marshmallow, Nougat and Oreo to this Android Pie repository. Most is available via archived tags in https://github.com/AndroidHardeningArchive/platform_bionic (check both the most recent Oreo and Nougat tags).
Stars: ✭ 66 (+100%)
Mutual labels:  libc
connect
tiny cross-platform socket API library
Stars: ✭ 46 (+39.39%)
Mutual labels:  libc
libc
KnightOS's C library
Stars: ✭ 30 (-9.09%)
Mutual labels:  libc
profiler-api
The portable version of JetBrains profiler API for .NET Framework / .NET Core / .NET / .NET Standard / Mono
Stars: ✭ 21 (-36.36%)
Mutual labels:  musl
rkorova
ld_preload userland rootkit
Stars: ✭ 34 (+3.03%)
Mutual labels:  libc
merelinux
A lightweight Linux distribution using musl libc, pacman and s6
Stars: ✭ 68 (+106.06%)
Mutual labels:  musl
crystal-autobind
Automatic C bindings generator for Crystal
Stars: ✭ 15 (-54.55%)
Mutual labels:  libc
stasis
build static rust position-independant-executables without any runtime requirements (no libc or ldso)
Stars: ✭ 40 (+21.21%)
Mutual labels:  musl
ghc-alt-libc
GHC compiled against musl & uClibc
Stars: ✭ 41 (+24.24%)
Mutual labels:  musl
CMLFS
Clang-Built Musl Linux From Scratch
Stars: ✭ 51 (+54.55%)
Mutual labels:  musl
Melvix
💻 A small operating system written from scratch
Stars: ✭ 69 (+109.09%)
Mutual labels:  libc
go-crypt
Golang wrappers for glibc crypt(3)
Stars: ✭ 36 (+9.09%)
Mutual labels:  libc
readhook
Red-team tool to hook libc read syscall with a buffer overflow vulnerability.
Stars: ✭ 31 (-6.06%)
Mutual labels:  libc
minilib
A c standard system library with a focus on size, headeronly, "singlefile", intended for static linking. 187 Bytes for "Hello World"(regular elf), compiled with the standard gcc toolchain.
Stars: ✭ 29 (-12.12%)
Mutual labels:  libc
crosware
Tools, things, stuff, miscellaneous, etc., for Chrome OS / Chromium OS
Stars: ✭ 36 (+9.09%)
Mutual labels:  musl
docker-rustup
Automated builded images for rust-lang with rustup, "the ultimate way to install RUST"
Stars: ✭ 78 (+136.36%)
Mutual labels:  musl
wcwidth
A Unicode 13-conformant implementation of wcwidth() in C.
Stars: ✭ 28 (-15.15%)
Mutual labels:  libc

detect-libc

Node.js module to detect details of the C standard library (libc) implementation provided by a given Linux system.

Currently supports detection of GNU glibc and MUSL libc.

Provides asychronous and synchronous functions for the family (e.g. glibc, musl) and version (e.g. 1.23, 1.2.3).

For previous v1.x releases, please see the v1 branch.

Install

npm install detect-libc

API

GLIBC

const GLIBC: string = 'glibc';

A String constant containing the value glibc.

MUSL

const MUSL: string = 'musl';

A String constant containing the value musl.

family

function family(): Promise<string | null>;

Resolves asychronously with:

  • glibc or musl when the libc family can be determined
  • null when the libc family cannot be determined
  • null when run on a non-Linux platform
const { family, GLIBC, MUSL } = require('detect-libc');

switch (await family()) {
  case GLIBC: ...
  case MUSL: ...
  case null: ...
}

familySync

function familySync(): string | null;

Synchronous version of family().

const { familySync, GLIBC, MUSL } = require('detect-libc');

switch (familySync()) {
  case GLIBC: ...
  case MUSL: ...
  case null: ...
}

version

function version(): Promise<string | null>;

Resolves asychronously with:

  • The version when it can be determined
  • null when the libc family cannot be determined
  • null when run on a non-Linux platform
const { version } = require('detect-libc');

const v = await version();
if (v) {
  const [major, minor, patch] = v.split('.');
}

versionSync

function versionSync(): string | null;

Synchronous version of version().

const { versionSync } = require('detect-libc');

const v = versionSync();
if (v) {
  const [major, minor, patch] = v.split('.');
}

isNonGlibcLinux

function isNonGlibcLinux(): Promise<boolean>;

Resolves asychronously with:

  • false when the libc family is glibc
  • true when the libc family is not glibc
  • false when run on a non-Linux platform
const { isNonGlibcLinux } = require('detect-libc');

if (await isNonGlibcLinux()) { ... }

isNonGlibcLinuxSync

function isNonGlibcLinuxSync(): boolean;

Synchronous version of isNonGlibcLinux().

const { isNonGlibcLinuxSync } = require('detect-libc');

if (isNonGlibcLinuxSync()) { ... }

Licensing

Copyright 2017, 2022 Lovell Fuller

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].