plan9port/src/cmd/9term/OpenBSD.c

16 lines
267 B
C
Raw Normal View History

2005-01-11 17:14:07 +00:00
#define getpts not_using_this_getpts
#include "bsdpty.c"
#undef getpts
2004-03-26 18:08:54 +00:00
int
getpts(int fd[], char *slave)
{
2005-01-11 17:14:07 +00:00
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;
}