---
name: "libproc_dev"
section: "3"
platform: "linux"
package: "libproc-dev"
version: "1.12.2"
release: "Debian 1.3 (Bo)"
platforms: ["linux"]
url: "https://new.carta.tech/libproc_dev"
---

# libproc\_dev(3)

lookup device names and numbers tty\_to\_dev, dev\_to\_tty - lookup tty names and numbers

## NAME

name\_to\_dev, dev\_to\_name - lookup device names and numbers tty\_to\_dev, dev\_to\_tty - lookup tty names and numbers

## SYNOPSIS

```
#include <proc/devname.h>

dev_t name_to_dev(char* name);
char* dev_to_name(dev_t num);
dev_t tty_to_dev(char *tty);
void  dev_to_tty(char *tty, dev_t dev);
```

## DESCRIPTION

Using (and updating, if possible) one of the  *psdevtab* files (see section FILES) these functions convert device names (names of special files in /dev/) to device numbers and back.  **tty** functions may use short forms for tty names (i.e. without leading  **tty** or  **cu**).\
 **dev\_to\_tty** will always return the abbreviated name and wants to have a string of length 4 as argument. Use  **dev\_to\_name** to get the full name.

## FILES

**/etc/psdevtab**, **/tmp/psdevtab**, **$HOME/psdevtab**.

## AUTHOR

The device lookup code in libproc was written by Charles L. Blake (cblake@bbn.com), this manpage was written by Helmut Geyer (Helmut.Geyer@iwr.uni-heidelberg.de).
