FreeBSD and statfs

From: Date: Tue, 15 May 2001 03:03:28 +0000
Subject: FreeBSD and statfs
Groups: php.dev 
Request: Send a blank email to php-dev+get-55286@lists.php.net to get a copy of this message
I was just working with ext/standard/filestat.c under FreeBSD. FreeBSD defines statfs(2) in <sys/mount.h> (not <sys/statfs.h>), so while autoconf determines that statfs(2) is available, it fails to locate <sys/statfs.h>, and the following dependencies fail: #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) struct statvfs buf; #elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS) struct statfs buf; #endif In the FreeBSD case, statfs is available but not used. I fixed this problem locally by removing some of the tests for 'defined(HAVE_SYS_STATFS_H)' and including <sys/mount.h>. I would like to commit this fix so that functions like diskfreespace() and my proposed disktotalspace() return correct results. Would the best way of fixing this problem be to do the above and include <sys/mount.h> conditionally under FreeBSD? Also note that this problem is also addressed in the user note on the diskfreespace() manual page: http://www.php.net/manual/en/function.diskfreespace.php -- Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology http://www.csh.rit.edu/~jon/ : Computer Science House Member

« previous php.dev (#55286) next »