*BSD News Article 84410


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!su-news-feed4.bbnplanet.com!netapp.com!netapp.com!not-for-mail
From: guy@netapp.com (Guy Harris)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: 6 Dec 1996 17:16:10 -0800
Organization: Network Appliance
Lines: 14
Distribution: inet
Message-ID: <58aggq$i1r@tooting.netapp.com>
References: <32986299.AC7@mail.esrin.esa.it> <5844u3$mb@saltmine.radix.net> <587t33$2va@anorak.coverform.lan> <casper.32a7ec57@mail.fwi.uva.nl>
NNTP-Posting-Host: tooting.netapp.com
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:91673 comp.unix.bsd.misc:1712 comp.unix.internals:11493

Casper H.S. Dik <casper@fwi.uva.nl> wrote:
>BTW, how did BSD solve "ftell()"?  Did they make a long 64 bits?
>
>(ftell() returns a *long*, not an off_t)

They solve it, as far as I can tell, by saying "if you want to use the
standard I/O library routines on files >4GB, you'd better use
'fgetpos()' and 'fsetpos()'" - "ftell()" returns a "long" and "fseek()"
takes a "long" in 4.4BSD, and "long"s are 32-bits on most BSD platforms
(Alpha is, as far as I know, the only exception).

"fpos_t" is, to something being compiled in "strict ANSI" land, a
structure containing an array of 8 bytes; to programs not so
constrained, it's a 64-bit integral "off_t".