Blame


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