aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term/NetBSD.c
blob: 18294803377e437f85addbf427acd8d0ea7e7df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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: %r");
	return 0;
}