---
name: "io_closeonexec"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/io_closeonexec"
---

# io\_closeonexec(3)

mark a file descriptor non-inheritable

## NAME

io\_closeonexec - mark a file descriptor non-inheritable

## SYNTAX

**#include \<libowfat/io.h\>**

void **io\_closeonexec**(int64 fd);

## DESCRIPTION

io\_closeonexec marks a file descriptor non-inheritable.  It will be automatically closed if the process executes a different one.  The descriptor will not be automatically closed when you fork() a new child process, though.

## SEE ALSO

[io\_wait(3)](/io_wait/3.md), [io\_canwrite(3)](/io_canwrite/3.md)
