* Copyright (c) 1983 The Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1983 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)rxformat.c 5.5 (Berkeley) %G%";
#include <vaxuba/rxreg.h>
char devname
[] = _PATH_DEVNAME
;
* Format RX02 floppy disks.
int fd
, idens
= 0, filarg
= 1;
if (argc
< 2 || argc
> 3)
if (strncmp(argv
[1],"-d",2) != 0)
devname
[8] = argv
[filarg
][7];
if ((fd
= open(devname
, O_RDWR
)) < 0) {
if (isatty(fileno(stdin
))) {
printf("Format %s to %s density (y/n)? ",
argv
[filarg
], idens
? "double" : "single");
while (c
!= '\n' && c
!= EOF
)
printf("Formatting %s to %s density\n",
argv
[filarg
], idens
? "double" : "single");
* Change the ioctl command when dkio.h has
if (ioctl(fd
, RXIOC_FORMAT
, &idens
) == 0)
fprintf(stderr
, "usage: rxformat [-d] /dev/rx?\n");