[BACK]Return to pty_openbsd.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / vim

File: [local] / src / usr.bin / vim / Attic / pty_openbsd.c (download)

Revision 1.2, Tue Oct 15 08:31:54 1996 UTC (27 years, 8 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2, OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.1: +2 -1 lines

Yeah, ok, so I never even bothered to test compile it before...

/*	$OpenBSD: pty_openbsd.c,v 1.2 1996/10/15 08:31:54 downsj Exp $	*/

/*
 * A quick, OpenBSD specific pty.c replacement.  It's not even entirely
 * correct; but it's certainly not GPL'd.
 */

#include <stdio.h>
#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);
}