blob: a79563880c4fe0fa7b8cfb614bff9624747aced3 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#define _XOPEN_SOURCE
2#include <sys/types.h>
3#include <sys/stat.h>
4#include <fcntl.h>
5#include <stdio.h>
6#include <stdlib.h>
7
8int main(int argc, char **argv)
9{
10 int fd;
11 char *cp;
12
13 fd=open("/dev/ptmx",O_NOCTTY|O_RDWR);
14 cp=ptsname(fd);
15 if (cp==NULL)
16 return EXIT_FAILURE;
17 printf("ptsname %s\n",cp);
18 return EXIT_SUCCESS;
19}
20