TERMKEY\_GET\_FD(3) Library Functions Manual TERMKEY\_GET\_FD(3)

# [NAME](#NAME)

termkey\_get\_fd - obtain the file descriptor for the terminal

# [SYNOPSIS](#SYNOPSIS)

```
#include <termkey.h>

int termkey_get_fd(TermKey *tk);
```

Link with *-ltermkey*.

# [DESCRIPTION](#DESCRIPTION)

**termkey\_get\_fd**() returns the file descriptor that the [**termkey**(7)](/man/os/libtermkey/termkey.7) instance is using to read bytes from.

# [RETURN VALUE](#RETURN_VALUE)

**termkey\_get\_fd**() returns the current file descriptor, or -1 if no file descriptor is associated with this instance.

# [SEE ALSO](#SEE_ALSO)

[**termkey\_new**(3)](/man/os/libtermkey/termkey_new.3), [**termkey\_get\_flags**(3)](/man/os/libtermkey/termkey_get_flags.3), [**termkey**(7)](/man/os/libtermkey/termkey.7)

---

Document: termkey_get_fd(3) from libtermkey 0.22-r8 (Chainguard OS)
