Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 May 2000 19:30:52 -0700
From:      "David O'Brien" <obrien@NUXI.com>
To:        nm <nm@vt.edu>, freebsd-alpha@FreeBSD.ORG
Subject:   (FWD) dd fix for Alpha
Message-ID:  <20000501193052.A2804@dragon.nuxi.com>

next in thread | raw e-mail | index | archive | help
----- Forwarded message from Matthew Jacob <mjacob@feral.com> -----
Date: Sun, 5 Dec 1999 15:19:18 -0800 (PST)
From: Matthew Jacob <mjacob@feral.com>
 
> How do we fix this problem?  I keeps from from
> ``dd if=/dev/da1 of=/dev/da2'' ??  I was very peeved at having to put the
> disks on a Solaris box to do such a normal Unix task.


this will fix your dd

Index: dd.c
===================================================================
RCS file: /home/ncvs/src/bin/dd/dd.c,v
retrieving revision 1.27
diff -u -r1.27 dd.c
--- dd.c	1999/10/03 18:49:51	1.27
+++ dd.c	1999/12/05 23:17:16
@@ -216,6 +216,16 @@
 		if (ioctl(io->fd, FIODTYPE, &type) == -1) {
 			err(1, "%s", io->name);
 		} else {
+if (type & D_DISK) {
+static int one = 1;
+#ifndef	DIOCWLABEL
+#define	DIOCWLABEL _IOW('d', 109, int) 
+#endif
+fprintf(stderr, "is a disk\n");
+if (ioctl(io->fd, DIOCWLABEL, &one) < 0) {
+perror("DIOCWLABEL");
+}
+}
 			if (type & D_TAPE)
 				io->flags |= ISTAPE;
 			else if (type & (D_DISK | D_MEM))




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000501193052.A2804>