plan9port/src/cmd/9term/OpenBSD.c
2005-07-21 18:29:04 +00:00

17 lines
286 B
C

#define getpts not_using_this_getpts
#include "bsdpty.c"
#undef getpts
#include <util.h>
int
getpts(int fd[], char *slave)
{
if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){
fchmod(fd[1], 0620);
strcpy(slave, ttyname(fd[0]));
return 0;
}
sysfatal("no ptys");
return 0;
}