FreeBSD defines statfs(2) in sys/mount.h, not in sys/statsfs.h as PHP expects. The following patch corrects the use of statfs(2) under FreeBSD, allowing disk_free_space() and disk_total_space() to report meaningful values. Any objections (or suggestions) to this patch? In theory, it would be nice to unbreak these functions in PHP 4.0.6, too, but there's really no rush being these functions haven't worked under FreeBSD for quite some time, anyway. -- Jon Parise ([EMAIL PROTECTED]) . Rochester Inst. of Technology http://www.csh.rit.edu/~jon/ : Computer Science House Member
? config ? mount_h.patch ? ext/standard/new Index: configure.in =================================================================== RCS file: /repository/php4/configure.in,v retrieving revision 1.251 diff -u -r1.251 configure.in --- configure.in 2001/05/19 22:21:40 1.251 +++ configure.in 2001/05/20 01:19:33 @@ -303,6 +303,7 @@ sysexits.h \ sys/file.h \ sys/mman.h \ +sys/mount.h \ sys/resource.h \ sys/select.h \ sys/socket.h \ Index: ext/standard/filestat.c =================================================================== RCS file: /repository/php4/ext/standard/filestat.c,v retrieving revision 1.67 diff -u -r1.67 filestat.c --- ext/standard/filestat.c 2001/05/15 23:43:18 1.67 +++ ext/standard/filestat.c 2001/05/20 01:19:34 @@ -43,6 +43,8 @@ # include <sys/statvfs.h> #elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) # include <sys/statfs.h> +#elif defined(HAVE_SYS_MOUNT_H) && defined(HAVE_STATFS) +# include <sys/mount.h> #endif #if HAVE_PWD_H @@ -151,7 +153,7 @@ #else /* not - WINDOWS */ #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) struct statvfs buf; -#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) +#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && +defined(HAVE_STATFS) struct statfs buf; #endif double bytestotal = 0; @@ -215,7 +217,7 @@ bytestotal = (((double)buf.f_blocks) * ((double)buf.f_bsize)); } -#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) +#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && +defined(HAVE_STATFS) if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE; bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks)); #endif @@ -252,7 +254,7 @@ #else /* not - WINDOWS */ #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) struct statvfs buf; -#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) +#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && +defined(HAVE_STATFS) struct statfs buf; #endif double bytesfree = 0; @@ -315,7 +317,7 @@ } else { bytesfree = (((double)buf.f_bavail) * ((double)buf.f_bsize)); } -#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) +#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && +defined(HAVE_STATFS) if (statfs((*path)->value.str.val,&buf)) RETURN_FALSE; bytesfree = (((double)buf.f_bsize) * ((double)buf.f_bavail)); #endif
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]