---
name: "io_close"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/io_close/3diet"
---

# io\_close(3diet)

close a file descriptor

## NAME

io\_close - close a file descriptor

## SYNTAX

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

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

## DESCRIPTION

io\_close eliminates the descriptor numbered *fd*. This usually does not mean eliminating the object that the descriptor is talking to. (For example, if a descriptor writes to a named disk file, closing the descriptor will not remove the file; it simply removes one way of writing to the file. On the other hand, a pipe disappears as soon as no descriptors refer to it.)

io\_close has no return value; it always succeeds in deallocating the memory used for the descriptor.  If *fd* is not the number of a descriptor, io\_close has no effect.

io\_close() is like close(), but it also removes the descriptor from the internal io\_wait() data structures.  If you called io\_fd on a descriptor, you need to use io\_close to close it, not just close().

## SEE ALSO

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