For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > March 2008 > Large file API









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Large file API
Alona

2008-03-17, 7:22 pm

Hello All;

Is there a payoff for using Large File API?
Why, for example, wouldn't one use xxx64() functions in all cases
rather than considering either to use 32-bit or 64-bit API.

Thank you,
Alona
Gordon Burditt

2008-03-17, 7:22 pm

>Is there a payoff for using Large File API?
>Why, for example, wouldn't one use xxx64() functions in all cases
>rather than considering either to use 32-bit or 64-bit API.


Because many operating systems don't HAVE xxx64() functions? (or,
rather, they are named xxx(), not xxx64(), and there is no 32-bit
API). FreeBSD (for versions >= about 2, I think) is one example.


George Peter Staplin

2008-03-17, 7:22 pm

Alona wrote:
> Hello All;
>
> Is there a payoff for using Large File API?
> Why, for example, wouldn't one use xxx64() functions in all cases
> rather than considering either to use 32-bit or 64-bit API.
>
> Thank you,
> Alona


It mostly relates to breaking compatibility AFAIK with the previous
structures and syscalls for old programs that can't be recompiled to
work with the new 64-bit syscalls, and environments where the Large
File Support isn't available.

-D_LARGEFILE_SOURCE and -D_LARGEFILE64_SOURCE are usually enough to
provide macro wrappers that use the 64-bit syscalls, as well as structs
that work with those. Generally you don't need to use the functions
with a 64 suffix directly in your code.

See this documentation on Large File Support:
http://www.unix.org/version2/whatsnew/lfs20mar.html


George
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com