| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #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 | |||||
| 8 | int 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 | |||||