blob: cf42a56af6fbd4ae25ae1464b778986429d3553f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* $OpenBSD: pty_openbsd.c,v 1.1 1996/09/07 21:40:28 downsj Exp $ */
/*
* A quick, OpenBSD specific pty.c replacement. It's not even entirely
* correct; but it's certainly not GPL'd.
*/
#include <sys/types.h>
#include <util.h>
int OpenPTY(name)
char **name;
{
static char ttyname[64];
int mfd, sfd, error;
error = openpty(&mfd, &sfd, ttyname, NULL, NULL);
if (error < 0)
return (-1);
*name = ttyname;
return (mfd);
}
|