You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2009/02/24 14:43:09 UTC

svn commit: r747380 - /harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c

Author: hindessm
Date: Tue Feb 24 13:43:09 2009
New Revision: 747380

URL: http://svn.apache.org/viewvc?rev=747380&view=rev
Log:
Use the more-portable POSIX statvfs calls rather than statfs calls.
The statfs(2) manual page on Linux says:

  Linux-specific. ...

  LSB has deprecated the library calls statfs() and fstatfs() and
  tells us to use statvfs(2) and fstatvfs(2) instead.

so this certainly seems like a sensible option and makes porting
easier.

Modified:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c?rev=747380&r1=747379&r2=747380&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c Tue Feb 24 13:43:09 2009
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/vfs.h>
+#include <sys/statvfs.h>
 
 #include <utime.h>
 
@@ -246,10 +246,10 @@
 }
 
 jlong getPlatformTotal (JNIEnv * env, char *path) {
-	struct statfs fs_buf;
+	struct statvfs fs_buf;
 	jlong total_size;
 	int ret;
-	if((ret = statfs(path, &fs_buf) < 0))
+	if((ret = statvfs(path, &fs_buf) < 0))
 	{
 		return 0l;
 	}
@@ -259,10 +259,10 @@
 }
 
 jlong getPlatformUsableTotal (JNIEnv * env, char *path) {
-    struct statfs fs_buf;
+    struct statvfs fs_buf;
 	jlong total_size;
 	int ret;
-	if((ret = statfs(path, &fs_buf) < 0))
+	if((ret = statvfs(path, &fs_buf) < 0))
 	{
 		return 0l;
 	}
@@ -272,10 +272,10 @@
 }
 
 jlong getPlatformFreeTotal (JNIEnv * env, char *path) {
-	struct statfs fs_buf;
+	struct statvfs fs_buf;
 	jlong total_size;
 	int ret;
-	if((ret = statfs(path, &fs_buf) < 0))
+	if((ret = statvfs(path, &fs_buf) < 0))
 	{
 		return 0l;
 	}