Blob
1 #define getpts not_using_this_getpts2 #include "bsdpty.c"3 #undef getpts4 #include <signal.h>6 int7 getpts(int fd[], char *slave)8 {9 void (*f)(int);11 f = signal(SIGCHLD, SIG_DFL);12 if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){13 fchmod(fd[1], 0620);14 strcpy(slave, ttyname(fd[0]));15 signal(SIGCHLD, f);16 return 0;17 }18 sysfatal("no ptys");19 return 0;20 }