Project

ffi-libc

0.04
No release in over 3 years
Low commit activity in last 3 years
Useful Ruby FFI bindings for libc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.0

Runtime

~> 1.0
 Project Readme

ffi-libc

CI Code Climate

Description

Useful Ruby FFI bindings for libc.

Features

  • Provides common Structs used in libc:
    • {FFI::LibC::Ifaddrs}
    • {FFI::LibC::In6Addr}
    • {FFI::LibC::InAddr}
    • {FFI::LibC::SockaddrDL}
    • {FFI::LibC::SockaddrFamily}
    • {FFI::LibC::SockaddrIn6}
    • {FFI::LibC::SockaddrIn}
    • {FFI::LibC::Sockaddr}
    • {FFI::LibC::Timeval}
    • {FFI::LibC::Timezone}
    • {FFI::LibC::RUsage}
  • Binds to common functions and global variables in libc:
    • errno.h:
      • sys_errlist (BSD)
      • sys_nerr (BSD)
      • errno
    • unistd.h:
      • brk
      • sbrk
      • getpid
      • getppid
      • getuid
      • geteuid
      • getgid
      • getegid
    • stdlib.h:
      • calloc
      • malloc
      • free
      • realloc
      • getenv
      • putenv
      • unsetenv
      • clearenv
    • time.h:
      • time
    • sys/time.h:
      • gettimeofday
      • settimeofday
    • sys/resource.h / bits/resource.h:
      • getrusage
    • sys/mman.h:
      • mmap
      • munmap
    • string.h:
      • bzero
      • memset
      • memcpy
      • memcmp
      • memchr
      • memrchr
      • strcpy
      • strncpy
      • strlen
      • index
      • rindex
      • strchr
      • strrchr
      • strstr
      • strerror
    • stdio.h:
      • stdin
      • stdout
      • stderr
      • fopen
      • fdopen
      • freopen
      • fseek
      • ftell
      • rewind
      • fread
      • fwrite
      • fgetc
      • fgets
      • fputc
      • fputs
      • fflush
      • fclose
      • clearerr
      • feof
      • ferror
      • fileno
      • perror
    • netdb.h:
      • getnameinfo
    • ifaddrs.h:
      • getifaddrs
      • freeifaddrs

Requirements

Install

$ gem install ffi-libc

gemspec

gem.add_dependency 'ffi-libc', '~> 0.1'

Gemfile

gem 'ffi-libc', '~> 0.1'

License

Copyright (c) 2010-2021 Hal Brodigan

See {file:LICENSE.txt} for license information.