From owner-freebsd-hackers Tue Dec 4 11:57:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 3F1CE37B416; Tue, 4 Dec 2001 11:57:06 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id fB4Jv1j20226; Tue, 4 Dec 2001 11:57:01 -0800 (PST) (envelope-from dillon) Date: Tue, 4 Dec 2001 11:57:01 -0800 (PST) From: Matthew Dillon Message-Id: <200112041957.fB4Jv1j20226@apollo.backplane.com> To: Ian Dowse Cc: Bernd Walter , cjclark@alum.mit.edu, Mark Hannon , bugs-followup@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: bin/32261: dump creates a dump file much larger than sum of dumped files References: <200112041339.aa05506@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : :In message <20011204135626.A75212@cicely8.cicely.de>, Bernd Walter writes: :>> Is there any reason we don't want to truncate the file? Does O_TRUNC :>> not work well of the file is a tape device or something? :> :>I don't expect O_TRUNK to work on devices such tapes and disks. : :Well, it won't achieve anything on tapes or disk devices, but it :should be completely harmless to add the O_TRUNC flag. The current :behaviour is likely to be unexpected and cause confusion so it :might as well be changed. I'll commit this later unless someone :can think of a good reason not to. : :Ian Woa! That sounds like a bad idea to me. If you want to do it right then open(), fstat(), and only if the stat says it is a regular file do you then ftruncate(). Passing O_TRUNC to a tape device may be ignored by us, but it's not a valid flag to pass to a tape device and we shouldn't do it. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message