PTSNAME(3) Linux Programmer's Manual PTSNAME(3)

ptsname - get the name of the slave pseudotty

#define _XOPEN_SOURCE

#include <stdlib.h>

char *ptsname(int fd);

The ptsname() function returns the name of the slave pseudo-terminal device (pty) corresponding to the master pty referred to by fd.

When successful, ptsname() returns a pointer to a string in static storage. This pointer must not be freed.

Upon failure, ptsname() returns a NULL pointer.

POSIX 1003.1-2001. This is part of the Unix98 pty support, see pts(4).

grantpt(3), ttyname(3), pts(4)

2003-01-30 PTY Control

Different Versions of this Page: