Re: Large File Support Standards

From: Frank Cusack (fcusack_at_fcusack.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 01:28:04 -0700

On Tue, 31 Aug 2004 04:00:32 -0400 Michael B Allen <mba2000@ioplex.com> wrote:
> On Linux the macros -D_FILE_OFFSET_BITS=64 is required to trigger 64bit
> off_t. But what does -D_LARGEFILE_SOURCE do?

Triggers fseeko() and ftello() availability.

> It doesn't need to be defined
> on my system to trigger 64but off_t and unlike _FILE_OFFSET_BITS it is
> not defined in the code.
>
> Also, if I need to conditionally compile something based on 64bit
> off_t would I check for _FILE_OFFSET_BITS, or _FILE_OFFSET_BITS > 64,
> or .. what?

I think you need to test for word size as well. From Solaris' libelf.h:

#if defined(_ILP32) && (_FILE_OFFSET_BITS != 32)
#error "large files are not supported by libelf"
#endif

> Finally what spec defines this stuff? The Open Group Base Specifications
> Issue 6 reference has no mention of varying sizes for off_t in unistd.h
> or in the descriptions of any of the functions that use it.

<http://www.sas.com/standards/large.file/>, the first hit for the
google search "large file summit". www.unix.org also has some interesting
pages (2nd hit from google search). Also, look at the Solaris lfcompile(5)
man page. (on docs.sun.com if you don't have a Solaris system)

/fc



Relevant Pages

  • Re: Unable to boot Solaris 10 after adding recommended patches
    ... Best to do a Google search on Solaris Rite DHCP and walk through Rich's tutorial. ...
    (comp.unix.solaris)
  • Re: Solaris 10 specifics
    ... Thomas H Jones II wrote: ... It's entirely possible that the OP did do a search and found a number of hits and wanted opions from people in this ... I did do a google search. ... Also if any one wants to be aware of the great things in Solaris 10 the easiest one is: ...
    (comp.unix.solaris)
  • netlink socket support in Solaris
    ... I am trying to port VRRP implementation from Linux to Solaris. ... Linux code makes use of netlink sockets. ... Based on google search results ...
    (comp.unix.solaris)
  • Re: Terminal Server client for Solaris?
    ... > install for Solaris? ... Do a Google search for rdesktop ...
    (comp.unix.solaris)