FFI(3)
β¨ NAME β¨
FFI β Foreign Function Interface
okay so bestie, you're reading FFI(3), and this is the manual page for the foreign function interface π it's lowkey iconic, highkey useful, and we're gonna get you comfy with it.
π LIBRARY π
- libffi β the library itself, and you link against it with
-lffiβ¨
πΈ SYNOPSIS πΈ
#include <ffi.h>
ffi_status
ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
ffi_type *rtype, ffi_type **atypes);
void
ffi_prep_cif_var(ffi_cif *cif, ffi_abi abi, unsigned int nfixedargs,
unsigned int ntotalargs, ffi_type *rtype, ffi_type **atypes);
void
ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);
π¦ DESCRIPTION π¦
so like, the foreign function interface provides a mechanism by which a function can generate a call to another function at runtime β and it does not require knowledge of the called function's interface at compile time. it's giving "call it later, figure it out live," and it ate π
literally the whole point is runtime flexibility, no cap.
π SEE ALSO π
π that's the whole page, bestie β FFI(3), dated February 15, 2008. mwah π
π¦ where this page comes from
- alpine 3.22: libffi-doc 3.4.8-r0 Β· MIT
- alpine 3.23: libffi-doc 3.5.2-r0 Β· MIT
- alpine 3.24: libffi-doc 3.5.2-r1 Β· MIT
- arch rolling: libffi 3.8.0-1 Β· MIT
- centos-stream 10: libffi-devel 3.4.4-10.el10 Β· MIT
- centos-stream 9: libffi-devel 3.4.2-8.el9 Β· MIT
- centos-stream 9: libffi-devel 3.4.2-8.el9 Β· MIT
- debian bookworm: libffi-dev 3.4.4-1
- debian trixie: libffi-dev 3.4.8-2
- fedora 43: libffi-devel 3.5.1-2.fc43 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- fedora 43: libffi-devel 3.5.1-2.fc43 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- fedora 43: libffi-devel 3.5.2-1.fc43 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- fedora 43: libffi-devel 3.5.2-1.fc43 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- fedora 44: libffi-devel 3.5.2-2.fc44 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- fedora 44: libffi-devel 3.5.2-2.fc44 Β· MIT AND CC-PDDC AND (GPL-3.0-or-later WITH Texinfo-exception)
- nixos 26.05: ruby3.3-ffi 1.17.2
- nixos 26.05: ruby3.4-ffi 1.17.2
- nixos 26.05: ruby4.0-ffi 1.17.2
- nixpkgs unstable: libffi 40
- nixpkgs unstable: ruby3.4-ffi 1.17.2
- nixpkgs unstable: ruby4.0-ffi 1.17.2
- opensuse-leap 16.0: libffi-devel 3.4.6-160000.2.2 Β· MIT
- opensuse-leap 16.0: libffi-devel 3.4.6-160000.2.2 Β· MIT
- opensuse-leap 16.0: libffi-devel 3.4.6-160000.2.2 Β· MIT
- opensuse-leap 16.0: libffi-devel 3.4.6-160000.2.2 Β· MIT
- ubuntu jammy: libffi-dev 3.4.2-4
- ubuntu noble: libffi-dev 3.4.6-1build1
- ubuntu questing: libffi-dev 3.5.2-1build1
- ubuntu resolute: libffi-dev 3.5.2-4
- ubuntu stonking: libffi-dev 3.8.0-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms