瀏覽代碼

fix statvfs syscalls (missing size argument)

Rich Felker 14 年之前
父節點
當前提交
7e795ca7ed
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      arch/x86_64/bits/statfs.h
  2. 1 1
      src/stat/fstatvfs.c
  3. 1 1
      src/stat/statvfs.c

+ 1 - 1
arch/x86_64/bits/statfs.h

@@ -11,5 +11,5 @@ struct statvfs {
 	unsigned long f_frsize;
 	fsfilcnt_t f_favail;
 	unsigned long f_flag;
-	unsigned long __reserved[2];
+	unsigned long __reserved[3];
 };

+ 1 - 1
src/stat/fstatvfs.c

@@ -4,7 +4,7 @@
 
 int fstatvfs(int fd, struct statvfs *buf)
 {
-	return syscall(SYS_fstatfs, fd, buf);
+	return syscall(SYS_fstatfs, fd, sizeof *buf, buf);
 }
 
 weak_alias(fstatvfs, fstatfs);

+ 1 - 1
src/stat/statvfs.c

@@ -4,7 +4,7 @@
 
 int statvfs(const char *path, struct statvfs *buf)
 {
-	return syscall(SYS_statfs, path, buf);
+	return syscall(SYS_statfs, path, sizeof *buf, buf);
 }
 
 weak_alias(statvfs, statfs);