summaryrefslogtreecommitdiff
path: root/Base/usr/share/man/man3/isatty.md
blob: 366607dcf1032ef7b65e24687450c1f4a0e54639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Name

isatty - check if a file descriptor is a TTY

## Synopsis

```**c++
#include <unistd.h>

int isatty(int fd);
```

## Description

Checks if the device inside a given file descriptor is a TTY device.

## Return value

If `fd` refers to a TTY device, returns 1. Otherwise, returns 0 and `errno` is set to describe the error.

## Errors

* `EBADF`: `fd` is not an open file descriptor.
* `ENOTTY`: `fd` refers to something that's not a TTY device.