summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2007-09-18 19:50:33 +0000
committerdwmalone <dwmalone@FreeBSD.org>2007-09-18 19:50:33 +0000
commit37c880369bbc54149ef96f87483805fbd3a376b7 (patch)
treefd0570d70b25da7a29c4ce04d71bd87ba30cb8ce /sys/compat
parentec62043bda5866bc1c94f6f9854b000cedb136a6 (diff)
downloadFreeBSD-src-37c880369bbc54149ef96f87483805fbd3a376b7.zip
FreeBSD-src-37c880369bbc54149ef96f87483805fbd3a376b7.tar.gz
The kernel version of Linux statfs64 is actually supposed to take
3 arguments, but we had forgotten the second argument. Also make the Linux statfs64 struct depend on the architecture because it has an extra 4 bytes padding on amd64 compared to i386. The three argument fix is from David Taylor, the struct statfs64 stuff is my fault. With this patch I can install i386 Linux matlab on an amd64 machine. Submitted by: David Taylor <davidt_at_yadt.co.uk> Approved by: re (kensmith)
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_stats.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 962c2f0..4dd9419 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -306,19 +306,6 @@ struct l_statfs {
l_int f_spare[6];
};
-struct l_statfs64 {
- l_int f_type;
- l_int f_bsize;
- uint64_t f_blocks;
- uint64_t f_bfree;
- uint64_t f_bavail;
- uint64_t f_files;
- uint64_t f_ffree;
- l_fsid_t f_fsid;
- l_int f_namelen;
- l_int f_spare[6];
-};
-
#define LINUX_CODA_SUPER_MAGIC 0x73757245L
#define LINUX_EXT2_SUPER_MAGIC 0xEF53L
#define LINUX_HPFS_SUPER_MAGIC 0xf995e849L
@@ -418,6 +405,9 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args)
char *path;
int error;
+ if (args->bufsize != sizeof(struct l_statfs64))
+ return EINVAL;
+
LCONVPATHEXIST(td, args->path, &path);
#ifdef DEBUG
OpenPOWER on IntegriCloud