#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>

int main(int argc, char **argv)
{
	int fd;

	if (argc != 2) {
		printf("Wrong usage!\n");
		exit(1);
	}

	if ((fd = open(argv[1], O_WRONLY)) == -1) {
		perror(argv[1]);
		exit(1);
	}

	if (ioctl(fd, TIOCCONS, NULL) == -1) {
		printf("ioctl: %s\n", strerror(errno));
		exit(1);
	}

	exit(0);
}
