Blob


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