1 PTSNAME(3C) Standard C Library Functions PTSNAME(3C) 2 3 NAME 4 ptsname - get the name of the subsidiary device of a pseudo-terminal 5 6 SYNOPSIS 7 #include <stdlib.h> 8 9 char * 10 ptsname(int fildes); 11 12 DESCRIPTION 13 The ptsname() function returns the name of the pseudo-terminal subsidiary 14 device associated with a pseudo-terminal manager device. The fildes 15 argument is a file descriptor returned from a successful open of the 16 pseudo-terminal manager device; e.g., by calling posix_openpt(3C) or by 17 performing an open(2) of the ptm(7D) device. 18 19 The ptsname() function returns a pointer to a string containing the null- 20 terminated path name of the subsidiary device. This string is of the 21 form /dev/pts/N, where N is a non-negative integer. 22 23 RETURN VALUES 24 If successful, the ptsname() function returns a pointer to a string which 25 is the name of the pseudo-terminal subsidiary device. This value points 26 to a static data area that is overwritten by each call to ptsname(). 27 28 Upon failure, ptsname() returns NULL. This could occur if fildes is an 29 invalid file descriptor or if the subsidiary device name does not exist 30 in the file system. 31 32 INTERFACE STABILITY 33 Committed 34 35 MT LEVEL 36 Safe 37 38 SEE ALSO 39 open(2), grantpt(3C), posix_openpt(3C), ttyname(3C), unlockpt(3C), 40 attributes(5), standards(5), ptm(7D), pts(7D) 41 42 illumos February 5, 2022 illumos