Subject: disquette eject ?
To: None <port-sparc@NetBSD.ORG>
From: Matthieu Herrb <matthieu@laas.fr>
List: port-sparc
Date: 03/17/1995 09:15:54
There is no program in the NetBSD tree to eject disquettes isn't there ?

Anyway, here's mine :


#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "/sys/arch/sparc/dev/fdvar.h"

main(int ac, char **av)
{
    char *dev;
    int fd;

    if (ac == 1) {
	dev = "/dev/rfd0a";
    } else {
	dev = av[1];
    }
    fd = open(dev, O_RDWR);
    if (fd < 0) {
	perror(dev);
	exit(1);
    } 
    if (ioctl(fd, FDIOCEJECT, 0) < 0) {
	perror(dev);
	exit(1);
    }
    close(fd);
    exit(0);
}

					Matthieu