Re: Compiler error while compiling XFree86-3.9.17

2000-02-01 Thread Chris Piazza

On Tue, Feb 01, 2000 at 03:30:36PM +0100, Theo van Klaveren wrote:
 
 I received the following compiler error while compiling the XFree86-3.9.17
 snapshot on a (very) fresh -CURRENT system:
 
 -- begin cut'n'paste --
 
  -- snip cut'n'paste --
   ...errors...
 
 -- end cut'n'paste --
 
 I assume this is a compiler bug. Is there a workaround or a patch 
 available for the system compiler or should I install the gcc-devel port
 (for which I probably don't have enough disk space, but oh well)?

The workaround is to compile the file that's dying with no optimisations.
It compiles fine without them... sorry I don't have a patch handy.

-Chris
-- 
[EMAIL PROTECTED]   [EMAIL PROTECTED]
Abbotsford, BC, Canada


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: sys/sockets.h error

1999-12-02 Thread Chris Piazza

On Thu, Dec 02, 1999 at 01:00:16AM -0800, Manny Obrey wrote:
 Hello,
 This may be a simple error on my part but I've narrowed my prob to
 the snippet below.
 
 When trying to compile:
 
 #include sys/sockets.h
 #include stdio.h
 
 int main () { return 0;}
 
 I get error messages which state parse errors in
 /usr/include/sys/socket.h
 
 Any suggestions would be appreciated.

man socket:
SYNOPSIS
 #include sys/types.h
 #include sys/socket.h

enough said.

snipped

-Chris
-- 
[EMAIL PROTECTED]   [EMAIL PROTECTED]
Abbotsford, BC, Canada


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Human readable df

1999-11-29 Thread Chris Piazza

On Mon, Nov 29, 1999 at 11:04:36PM -0500, [EMAIL PROTECTED] wrote:
 Not sure if -hackers is the place for this, but here goes.
 
 Here's a patch to add -h flag to df to produce human readable
 output. This makes it easier to read if the disk is big.
 Example:
 
 [badmofo@/home/matt] df -h
 FilesystemSize   UsedAvail Capacity Mounted on
 /dev/wd0s1a   722M20M   644M 3% /
 /dev/wd0s2h   9.9G   4.4G   4.8G48% /usr
 procfs4.0K   4.0K 0B   100% /proc
 
 
 Code merged from OpenBSD and added to FreeBSD-STABLE. 

[patch snipped]

For what it's worth, I'd ported this a few months back (file dated
Aug 28), but forgot about it :-).  Here's the patch updated for
-current, anyway.

Index: df.1
===
RCS file: /home/ncvs/src/bin/df/df.1,v
retrieving revision 1.17
diff -u -r1.17 df.1
--- df.11999/11/01 04:57:42 1.17
+++ df.11999/11/30 05:38:47
@@ -40,7 +40,7 @@
 .Nd display free disk space
 .Sh SYNOPSIS
 .Nm df
-.Op Fl aikn
+.Op Fl ahikmn
 .Op Fl t Ar type
 .Op Ar file | Ar filesystem ...
 .Sh DESCRIPTION
@@ -62,6 +62,10 @@
 .It Fl a
 Show all mount points, including those that were mounted with the MNT_IGNORE
 flag.
+.It Fl h
+"Human-readable" output.  Use unit suffixes: Byte, Kilobyte, Megabyte,
+Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
+digits to four or less.
 .It Fl i
 Include statistics on the number of free inodes.
 .It Fl k
Index: df.c
===
RCS file: /home/ncvs/src/bin/df/df.c,v
retrieving revision 1.22
diff -u -r1.22 df.c
--- df.c1999/11/01 04:57:43 1.22
+++ df.c1999/11/30 05:38:47
@@ -59,21 +59,27 @@
 #include err.h
 #include errno.h
 #include fcntl.h
+#include math.h
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include unistd.h
 
+typedef enum { NONE = 0, KILO, MEGA, GIGA, TERA, PETA /* , EXA */ } unit_t;
+
 int  checkvfsname __P((const char *, char **));
 char   **makevfslist __P((char *));
 long regetmntinfo __P((struct statfs **, long, char **));
 int  bread __P((off_t, void *, int));
 char*getmntpt __P((char *));
+void prthuman __P((struct statfs *, long));
+void prthumanval __P((double)); 
 void prtstat __P((struct statfs *, int));
 int  ufs_df __P((char *, int));
+unit_t   unit_adjust __P((double *));
 void usage __P((void));
 
-intaflag = 0, iflag, nflag;
+intaflag = 0, hflag, iflag, nflag;
 struct ufs_args mdev;
 
 int
@@ -88,11 +94,14 @@
char *mntpt, *mntpath, **vfslist;
 
vfslist = NULL;
-   while ((ch = getopt(argc, argv, "aiknt:")) != -1)
+   while ((ch = getopt(argc, argv, "ahiknt:")) != -1)
switch (ch) {
case 'a':
aflag = 1;
break;
+   case 'h':
+   hflag = 1;
+   break;
case 'i':
iflag = 1;
break;
@@ -249,6 +258,68 @@
 }
 
 /*
+ * Output in "human-readable" format.  Uses 3 digits max and puts
+ * unit suffixes at the end.  Makes output compact and easy to read,
+ * especially on huge disks.
+ *
+ */
+
+unit_t
+unit_adjust(val)
+   double *val;
+{
+   double abval;
+   unit_t unit;
+
+   abval = fabs(*val);
+   if (abval  1024)
+   unit = NONE;
+   else if (abval  1048576ULL) {
+   unit = KILO;
+   *val /= 1024;
+   } else if (abval  1073741824ULL) {
+   unit = MEGA;
+   *val /= 1048576;
+   } else if (abval  1099511627776ULL) {
+   unit = GIGA;
+   *val /= 1073741824ULL;
+   } else if (abval  1125899906842624ULL) {
+   unit = TERA;
+   *val /= 1099511627776ULL;
+   } else if (abval  1152921504606846976ULL) {
+   unit = PETA;
+   *val /= 1125899906842624ULL;
+   }
+   return (unit);
+}
+
+void
+prthuman(sfsp, used)
+   struct statfs *sfsp;
+   long used; 
+{
+   prthumanval((double)(sfsp-f_blocks) * (double)(sfsp-f_bsize));
+   prthumanval((double)(used) * (double)(sfsp-f_bsize));
+   prthumanval((double)(sfsp-f_bavail) * (double)(sfsp-f_bsize));
+}
+
+void
+prthumanval(bytes)
+   double bytes;
+{
+   unit_t unit;
+
+   unit = unit_adjust(bytes);
+
+   if (bytes == 0)
+   (void)printf(" 0B");
+   else if (bytes  10)
+   (void)printf(" %5.0f%c", bytes, "BKMGTPE"[unit]);
+   else
+   (void)printf(" %5.1f%c", bytes, "BKMGTPE"[unit]);
+}
+
+/*
  * Convert statfs returned filesystem size into BLOCKSIZE units.
  * Attempts to avoid overflow for large filesystems.
  */
@@ -272,9 +343,16 @@
if (maxwidth  11)
maxwidth = 11;
if (++timesthrough == 1) {
-   header = getbsize(headerlen, 

Re: Human readable df

1999-11-29 Thread Chris Piazza

On Mon, Nov 29, 1999 at 09:39:53PM -0800, Chris Piazza wrote:

Oops, plus the usage change which I forgot (of course).

@@ -382,6 +463,6 @@
 usage()
 {
(void)fprintf(stderr,
-   "usage: df [-aikn] [-t type] [file | filesystem ...]\n");
+   "usage: df [-ahikn] [-t type] [file | filesystem ...]\n");
exit(1);
 }

-Chris
--
[EMAIL PROTECTED]   [EMAIL PROTECTED]
Abbotsford, BC, Canada


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: updating packages automatically...

1999-09-28 Thread Chris Piazza

On Tue, Sep 28, 1999 at 08:40:50PM -0700, Doug White wrote:
 On Tue, 28 Sep 1999, Mark Shepard wrote:
 
  I _like_ the idea of a email-summary of "What's New in the World of Ports".
 
 We used to have this.  I think it morphed into the webpage mutation we
 have now (note you can request all the changed ports in the last X time
 frame).
 
 Maybe it's posted to the -ports mailing list?

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=580888+0+archive/1999/freebsd-ports/19990919.freebsd-ports

 
  - Before I do a "make install", is there some way to
find out exactly which dependencies of the port I'm installing are also
going to need to be upgraded?
 
 I think a 'make checkdep' type target to run the dependency check w/o
 actually building them would be a plus.  This should be very easy to do w/
 the current bsd.port.mk frame.

make package-depends might be what you're looking for.

-Chris
-- 
:Chris Piazza  : Abbotsford, BC:
:[EMAIL PROTECTED]  :[EMAIL PROTECTED]: 
:  :   :


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [mount.c]: Option user-patch

1999-08-29 Thread Chris Piazza
On Sun, Aug 29, 1999 at 06:30:35PM -0400, Chris D. Faulhaber wrote:
 On Sun, 29 Aug 1999, Natty Rebel wrote:
 
  This procedure can be automated by entering the following command
  in /etc/rc.sysctl
  sysctl -w vfs.usermount=1
  
 
 Maybe it's just me, but I think you are confusing this with
 {Net|Open}BSD.  /etc/rc.sysctl does not exist in FreeBSD.


Re: Pictures from USENIX

1999-07-05 Thread Chris Piazza
On Mon, Jul 05, 1999 at 12:12:55AM -0600, Wes Peters wrote:

[cc's trimmed]

 Tim Vanderhoek wrote:
  
  On Sun, Jul 04, 1999 at 12:15:02PM -0700, Jordan K. Hubbard wrote:
  
   read a bit about them.  Same for the committers group, but at 165+
   members that's going to be a somewhat larger, long-term project. :-)
  
  Did Wes Peters finish his collection of committer ICBMNet lat/long
  co-ordinates?
 
 Here's what I have so far:
 #
 # Walnut Creek, our good friends.
 #
 37.91  -122.06 Walnut Creek   # Walnut Creek CD-ROM
 #

snip

49.01, -122.68,  cpiazza   # near Vancouver, BC

Wow, right on the 49th parallel!  (FYI I can walk to the US border
from my apartment...)

snip
 
 So far, Eivind is the northernmost and Grog and the Adelaide crowd the
 southernmost.  BDE is the easternmost and Jordan the westernmost.  The
 largest concentration so far is Boulder Colorado with 4, followed by
 the Adelaide gang with 3.  This, of course, doesn't count the bay area
 which is a lot of small town.

Not enough Canadians, I think.

-Chris

-- 
cpia...@home.net   cpia...@freebsd.org
Optimist, n.  A proponent of the doctrine that black
 is white.-Ambrose Bierce


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



RE: [Fwd: Good news from NVIDIA]

1999-06-03 Thread Chris Piazza
On 03-Jun-99 Daniel O'Connor wrote:
 
 On 03-Jun-99 Wes Peters wrote:
  http://www.nvidia.com/Marketing/Products/Pages.nsf/pages/NVIDIA_Drivers
  
  Does anyone know how/if/when this will bleed over to FreeBSD?  A
  killer cheap OpenGL box might be kinda fun to have, and I'm already
  in the market for another desktop.  TNT cards have gotten pretty
  cheap...
 
 Well the patches are there :)
 
 I suppose it would work OK, but no TNT to test with either.
 
 My friend is getting an Asus TNT2 soon, so I will try it and see :)
 

I was about to try this myself.  I have a Creative Labs TNT (AGP) in this box. 
Just downloading the XFree86 source right now and I'm going to build it
overnight assuming it works.  If not I'm sure it'll be fun (heh) to track down.

---
Chris PiazzaAbbotsford, BC, Canada
   cpia...@home.net
finger n...@norn.ca.eu.org for PGP key


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message