---
name: "std::system_error"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::system_error"
---

# std::system\_error(3)

An exception type that includes an error\_code value.

## NAME

std::system\_error - An exception type that includes an error\_code value.

## SYNOPSIS

\#include \<system\_error\>

Inherits **std::runtime\_error**.

Inherited by **std::experimental::filesystem::v1::filesystem\_error**, **std::filesystem::filesystem\_error**, and **std::ios\_base::failure**.

### Public Member Functions

**system\_error** (const system\_error &)=default\
 **system\_error** (**error\_code** \_\_ec, const char \*\_\_what)\
 **system\_error** (**error\_code** \_\_ec, const **string** &\_\_what)\
 **system\_error** (**error\_code** \_\_ec=**error\_code**())\
 **system\_error** (int \_\_v, const **error\_category** &\_\_ecat)\
 **system\_error** (int \_\_v, const **error\_category** &\_\_ecat, const char \*\_\_what)\
 **system\_error** (int \_\_v, const **error\_category** &\_\_ecat, const **string** &\_\_what)\
 const **error\_code** & **code** () const noexcept\
 system\_error & **operator=** (const system\_error &)=default\
 virtual const char \* **what** () const noexcept\

## Detailed Description

An exception type that includes an error\_code value.

Typically used to report errors from the operating system and other low-level APIs.

**Since**

C++11

## Member Function Documentation

### virtual const char \* std::runtime\_error::what () const \[virtual\], \[noexcept\], \[inherited\]

Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).

Reimplemented from **std::exception**.

Reimplemented in **std::experimental::filesystem::v1::filesystem\_error**, **std::filesystem::filesystem\_error**, and **std::ios\_base::failure**.

References **what()**.

Referenced by **what()**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
