Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2001 18:22:44 +0200
From:      Bernd Walter <ticso@mail.cicely.de>
To:        freebsd-alpha@freebsd.org
Subject:   fstat pointersize patch
Message-ID:  <20010714182244.B23031@cicely20.cicely.de>

next in thread | raw e-mail | index | archive | help

--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Compiling fstat produced a lot of warning and printed only the
lower part of the addresses.
The patch was made on -current as of 2001-03-28 on alpha and
test applied to a -current as of 2001-07-04 on i386.
The output on i386 looks the same as before.

I did the path because I want to see sockstat working on alpha but
there seem to be other issues too.

-- 
B.Walter              COSMO-Project         http://www.cosmo-project.de
ticso@cicely.de         Usergroup           info@cosmo-project.de


--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fstat.diff"

Index: fstat.c
===================================================================
RCS file: /vol/freebsd-cvs/src/usr.bin/fstat/fstat.c,v
retrieving revision 1.26
diff -u -r1.26 fstat.c
--- fstat.c	2001/02/15 22:42:44	1.26
+++ fstat.c	2001/07/14 16:09:49
@@ -661,7 +661,7 @@
 		goto bad;
 	}
 
-	printf("* pipe %8x <-> %8x", (int)pi, (int)pip.pipe_peer);
+	printf("* pipe %p <-> %p", pi, pip.pipe_peer);
 	printf(" %6d", (int)pip.pipe_buffer.cnt);
 	rw[0] = '\0';
 	if (flag & FREAD)
@@ -759,16 +759,16 @@
 					    (void *)so.so_pcb);
 					goto bad;
 				}
-				printf(" %x", (int)inpcb.inp_ppcb);
+				printf(" %p", inpcb.inp_ppcb);
 			}
 		}
 		else if (so.so_pcb)
-			printf(" %x", (int)so.so_pcb);
+			printf(" %p", so.so_pcb);
 		break;
 	case AF_UNIX:
 		/* print address of pcb and connected pcb */
 		if (so.so_pcb) {
-			printf(" %x", (int)so.so_pcb);
+			printf(" %p", so.so_pcb);
 			if (kvm_read(kd, (u_long)so.so_pcb, (char *)&unpcb,
 			    sizeof(struct unpcb)) != sizeof(struct unpcb)){
 				dprintf(stderr, "can't read unpcb at %p\n",
@@ -785,14 +785,14 @@
 				if (!(so.so_state & SS_CANTSENDMORE))
 					*cp++ = '>';
 				*cp = '\0';
-				printf(" %s %x", shoconn,
-				    (int)unpcb.unp_conn);
+				printf(" %s %p", shoconn,
+				    unpcb.unp_conn);
 			}
 		}
 		break;
 	default:
 		/* print protocol number and socket address */
-		printf(" %d %x", proto.pr_protocol, (int)sock);
+		printf(" %d %p", proto.pr_protocol, sock);
 	}
 	printf("\n");
 	return;
@@ -814,8 +814,8 @@
 	if (KVM_READ(dev, &si, sizeof si)) {
 		return si.si_udev;
 	} else {
-		dprintf(stderr, "can't convert dev_t %p to a udev_t\n",
-		    (void *)dev);
+		dprintf(stderr, "can't convert dev_t %x8 to a udev_t\n",
+		    dev);
 		return -1;
 	}
 }

--u3/rZRmxL6MmkK24--

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?20010714182244.B23031>