*BSD News Article 92991


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.syd.connect.com.au!phaedrus.kralizec.net.au!not-for-mail
From: bde@zeta.org.au (Bruce Evans)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: _BSD_OFF_T_ type long long
Date: 7 Apr 1997 15:37:43 +1000
Organization: Kralizec Dialup Unix
Lines: 32
Message-ID: <5ia177$62a@godzilla.zeta.org.au>
References: <33448ed9.0@usamrid.isd.net> <3348453D.3CC7@onthenet.com.au>
NNTP-Posting-Host: godzilla.zeta.org.au
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:38620

In article <3348453D.3CC7@onthenet.com.au>,
Tony Griffiths  <tonyg@OntheNet.com.au> wrote:
>Jim Drinkwater wrote:
>> 
>> Why is _BSD_OFF_T_ defined as type long long (see below)
>> in <machine/ansi.h>?  I am running FreeBSD 2.2-961014-SNAP.
>> 
>> #define _BSD_OFF_T_     long long               /* file offset */
>
>I presume this is to allow for devices/files bigger than 2GB (ie.
>a true 64-bit filesystem).

64-bit offsets are standard in BSD4.4Lite.  They woke many sleeping
bugs.

>In 2.1.x (or 2.1.5 at least), you can't position beyond 2G in a
>raw partition for instance.  This caused me some problems when

Kernel offsets withing partitions were broken (limited to 2G or 4G)
in FreeBSD-2.0.  This was fixed in FreeBSD-2.0.5.

>trying to move a news partition off a flaky disk.  I was forced
>to copy the ENTIRE 4.3GB several times because I could work out
>'dd' options to allow for the "end-of-disk" condition.  In 
>reality all I needed was the last few block of the disk copied
>again but could offset to them!

dd seek offsets are still broken.  There is an obvious overflow bug
in pos_in(), and 32-bit block numbers are used throughout, so when
the block size is small, offsets are more limited than in the kernel.
-- 
Bruce Evans  bde@zeta.org.au