Blame


1 7321ed03 2017-10-13 0intro #define getpts not_using_this_getpts
2 67e4fce4 2004-04-19 devnull #include "bsdpty.c"
3 7321ed03 2017-10-13 0intro #undef getpts
4 7321ed03 2017-10-13 0intro
5 7321ed03 2017-10-13 0intro #include <util.h>
6 7321ed03 2017-10-13 0intro
7 7321ed03 2017-10-13 0intro int
8 7321ed03 2017-10-13 0intro getpts(int fd[], char *slave)
9 7321ed03 2017-10-13 0intro {
10 7321ed03 2017-10-13 0intro if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){
11 7321ed03 2017-10-13 0intro fchmod(fd[1], 0620);
12 7321ed03 2017-10-13 0intro strcpy(slave, ttyname(fd[0]));
13 7321ed03 2017-10-13 0intro return 0;
14 7321ed03 2017-10-13 0intro }
15 7321ed03 2017-10-13 0intro sysfatal("no ptys");
16 7321ed03 2017-10-13 0intro return 0;
17 7321ed03 2017-10-13 0intro }