---
name: "outsb"
section: "2"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/outb/2"
---

# outsb(2)

port I/O

Part of [outb(2)](/outb/2.md).

## NAME

outb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, outb\_p, outw\_p, outl\_p, inb\_p, inw\_p, inl\_p - port I/O

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <sys/io.h>
```

**unsigned char inb(unsigned short** *port***);** **unsigned char inb\_p(unsigned short** *port***);** **unsigned short inw(unsigned short** *port***);** **unsigned short inw\_p(unsigned short** *port***);** **unsigned int inl(unsigned short** *port***);** **unsigned int inl\_p(unsigned short** *port***);**

**void outb(unsigned char** *value***, unsigned short** *port***);** **void outb\_p(unsigned char** *value***, unsigned short** *port***);** **void outw(unsigned short** *value***, unsigned short** *port***);** **void outw\_p(unsigned short** *value***, unsigned short** *port***);** **void outl(unsigned int** *value***, unsigned short** *port***);** **void outl\_p(unsigned int** *value***, unsigned short** *port***);**

**void insb(**unsigned long count;            **unsigned short** *port***, void** *addr***\[***count***\],**            **unsigned long** *count***);** **void insw(**unsigned long count;            **unsigned short** *port***, void** *addr***\[***count***\],**            **unsigned long** *count***);** **void insl(**unsigned long count;            **unsigned short** *port***, void** *addr***\[***count***\],**            **unsigned long** *count***);** **void outsb(**unsigned long count;            **unsigned short** *port***, const void** *addr***\[***count***\],**            **unsigned long** *count***);** **void outsw(**unsigned long count;            **unsigned short** *port***, const void** *addr***\[***count***\],**            **unsigned long** *count***);** **void outsl(**unsigned long count;            **unsigned short** *port***, const void** *addr***\[***count***\],**            **unsigned long** *count***);**

## DESCRIPTION

This family of functions is used to do low-level port input and output. The out\* functions do port output, the in\* functions do port input; the b-suffix functions are byte-width and the w-suffix functions word-width; the \_p-suffix functions pause until the I/O completes.

They are primarily designed for internal kernel use, but can be used from user space.

You must compile with **-O** or **-O2** or similar. The functions are defined as inline macros, and will not be substituted in without optimization enabled, causing unresolved references at link time.

You use [**ioperm**(2)](/ioperm/2.md) or alternatively [**iopl**(2)](/iopl/2.md) to tell the kernel to allow the user space application to access the I/O ports in question. Failure to do this will cause the application to receive a segmentation fault.

## VERSIONS

**outb**() and friends are hardware-specific. The *value* argument is passed first and the *port* argument is passed second, which is the opposite order from most DOS implementations.

## STANDARDS

None.

## SEE ALSO

[**ioperm**(2)](/ioperm/2.md), [**iopl**(2)](/iopl/2.md)
