summaryrefslogtreecommitdiff
path: root/test/stdlib/ptytest.c
blob: dd531b4165eab3f6990ba36176f7a961f29c6477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#define _XOPEN_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int fd;
    char *cp;

    fd=open("/dev/ptmx",O_NOCTTY|O_RDWR);
    cp=ptsname(fd);
    if (cp==NULL)
	return EXIT_FAILURE;
    printf("ptsname %s\n",cp);
    return EXIT_SUCCESS;
}