---
name: "ffi"
section: "3"
platform: "linux"
package: "libffi"
version: "3.8.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/ffi"
---

# ffi(3)

Foreign Function Interface

## NAME

**FFI** – Foreign Function Interface

## LIBRARY

libffi, -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

The foreign function interface provides a mechanism by which a function can generate a call to another function at runtime without requiring knowledge of the called function's interface at compile time.

## SEE ALSO

[ffi\_prep\_cif(3)](/ffi_prep_cif/3.md), [ffi\_prep\_cif\_var(3)](/ffi_prep_cif_var/3.md), [ffi\_call(3)](/ffi_call/3.md)
