From e177759a416ea6ef09860382e66d9a3afc94a7fe Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Tue, 1 Mar 2005 14:24:34 +0000 Subject: The maximum file size on MS-DOS filesystems is 4 GB - 1 byte, so don't bother trying to write files bigger than this. Just return EFBIG to caller, rather than panic()ing later. Closes PR 4090. Assistance from otto@, tested by OP and moritz@; thanks. ok tedu@ deraadt@ --- sys/msdosfs/denode.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/msdosfs/denode.h') diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h index 14b7ccbab0d..827433ac702 100644 --- a/sys/msdosfs/denode.h +++ b/sys/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: denode.h,v 1.17 2004/05/14 04:05:05 tedu Exp $ */ +/* $OpenBSD: denode.h,v 1.18 2005/03/01 14:24:33 tom Exp $ */ /* $NetBSD: denode.h,v 1.24 1997/10/17 11:23:39 ws Exp $ */ /*- @@ -178,6 +178,9 @@ struct denode { */ #define WIN_MAXLEN 255 +/* Maximum size of a file on a FAT filesystem */ +#define MSDOSFS_FILESIZE_MAX 0xFFFFFFFFLL + /* * Transfer directory entries between internal and external form. * dep is a struct denode * (internal form), -- cgit v1.2.3