SysIII/usr/src/lib/lib2/gtty.c

Compare this file to the similar file:
Show the results in this format:

static char	sccsid[] = "@(#)gtty.c	4.1";

# include "saio.h"
# include <sgtty.h>

gtty(fildes, arg)
struct sgttyb *arg; {
	extern struct sgttyb _ttstat;

	if (fildes < 0 || fildes > 2) {
		errno = ENOTTY;
		return (-1);
	}

	strncpy((char *) arg, (char *) &_ttstat, sizeof _ttstat);
	return (0);
}