*BSD News Article 84335


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!news.eng.convex.com!newshost.convex.com!newsgate.duke.edu!news.mathworks.com!news.sprintlink.net!news-peer.sprintlink.net!EU.net!Austria.EU.net!01-newsfeed.univie.ac.at!CARNet.hr!dave
From: dave@pc-damir.srce.hr (Drazen Kacar)
Newsgroups: comp.unix.solaris,comp.unix.bsd.misc,comp.unix.internals
Subject: Re: Solaris 2.6
Date: 6 Dec 1996 04:28:33 GMT
Organization: Cardak ni na nebu, ni na zemlji
Lines: 32
Distribution: world
Message-ID: <slrn5af88v.199.dave@pc-damir.srce.hr>
References: <32986299.AC7@mail.esrin.esa.it> <580sgh$kpi@panix2.panix.com> <casper.32a40b7b@mail.fwi.uva.nl> <587jrv$9rf@news.parc.xerox.com> <587meg$h67@web.nmti.com> <5880ig$1a5$1@shade.twinsun.com>
Reply-To: dave@fly.cc.fer.hr
NNTP-Posting-Host: pc-damir.srce.hr
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Newsreader: slrn (0.8.7.1 UNIX)
Xref: euryale.cc.adfa.oz.au comp.unix.solaris:91537 comp.unix.bsd.misc:1687 comp.unix.internals:11469

In article <5880ig$1a5$1@shade.twinsun.com>, Paul Eggert wrote:
>peter@nmti.com (Peter da Silva) writes:
>
>> The Sun approach requires a #define to indicate you want to use the *new*
>> versions of the header files to link with 64-bit libraries.
>
>Is this really true?  (Sorry, I haven't been following this debate.)
>
>I don't want to add something like `#define _LARGEFILE64_SOURCE'
>to each module that wants to work correctly with large Solaris files.
>Nor do I want to change lseek/off_t to llseek/offset_t.
>That sort of thing would be a porting nightmare.
>Surely Sun isn't planning anything as braindamaged as that.

But of course they are. Thou shalt use off_t and ifdef it for Solaris 2.6
Suppose you have:

   fstat(fd, &inode)
   printf("%d\n", inode.st_size);

st_size is off_t (64 bits), but %d wants int (32 bits, the same as long).
Thou shalt use "%dll" and guard it with ifdef from normal systems.
And if not... Imagine all those HTTP servers returning "Content-Length: 0".

Now, if you don't put that define, everything works. Or not? :)

-- 
Life is a sexually transmitted disease.

dave@fly.cc.fer.hr
dave@zemris.fer.hr