public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* 64 bit I/O functions (such as stat/ftruncate)
@ 2007-12-06 19:51 John Gateley
  2007-12-06 20:15 ` Brian Dessent
  2007-12-06 20:29 ` John (Eljay) Love-Jensen
  0 siblings, 2 replies; 4+ messages in thread
From: John Gateley @ 2007-12-06 19:51 UTC (permalink / raw)
  To: gcc-help

I'm looking for 64 bit I/O functions, such as ftruncate or
stat/fstat/lstat. Some functions exist in 64 bit versions
(such as lseek64), but for others I couldn't find anything.
This is using g++ on linux.

Sorry if this isn't the appropriate venue for this question.
I couldn't find a better one. Please direct me on if it isn't.

j
-- 
John Gateley <gateley@jriver.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 64 bit I/O functions (such as stat/ftruncate)
  2007-12-06 19:51 64 bit I/O functions (such as stat/ftruncate) John Gateley
@ 2007-12-06 20:15 ` Brian Dessent
  2007-12-06 21:32   ` John Gateley
  2007-12-06 20:29 ` John (Eljay) Love-Jensen
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Dessent @ 2007-12-06 20:15 UTC (permalink / raw)
  To: John Gateley; +Cc: gcc-help

John Gateley wrote:

> I'm looking for 64 bit I/O functions, such as ftruncate or
> stat/fstat/lstat. Some functions exist in 64 bit versions
> (such as lseek64), but for others I couldn't find anything.
> This is using g++ on linux.

Normally you don't call the 64 bit versions explicitly, you just add
-D_FILE_OFFSET_BITS=64 to CPPFLAGS and you get the large-file aware
version of all interfaces without the 64 suffix.  If you really want to
call them by name then you instead define _LARGEFILE64_SOURCE and you
get the interfaces with the 64 suffix, but that was only added as a
crutch for the transition period where some programs weren't LFS aware. 
Those days should hopefully be in the past, so don't uglify your code
unnecessarily.

> Sorry if this isn't the appropriate venue for this question.
> I couldn't find a better one. Please direct me on if it isn't.

These functions are provided by the libc, which is not a part of gcc, so
it's technically off topic here.  See the glibc manual for details:
<http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html>.

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: 64 bit I/O functions (such as stat/ftruncate)
  2007-12-06 19:51 64 bit I/O functions (such as stat/ftruncate) John Gateley
  2007-12-06 20:15 ` Brian Dessent
@ 2007-12-06 20:29 ` John (Eljay) Love-Jensen
  1 sibling, 0 replies; 4+ messages in thread
From: John (Eljay) Love-Jensen @ 2007-12-06 20:29 UTC (permalink / raw)
  To: John Gateley, gcc-help

Hi John,

Those questions are Linux related, not GCC related.

I'm sure GCC will support the Linux 64-bit I/O API routines without a hitch.  But whether or not your particular Linux supports 64-bit I/O API routines and what those APIs are... well, that's Linux issue.

Note:  I'd expect the standard routines like lseek to be 64-bit savvy if the OS supports 64-bit file systems, without having special 64-bit one-offs, like lseek64, and things like off_t being typedef'd to a 64-bit integer (probably a signed long long).

--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 64 bit I/O functions (such as stat/ftruncate)
  2007-12-06 20:15 ` Brian Dessent
@ 2007-12-06 21:32   ` John Gateley
  0 siblings, 0 replies; 4+ messages in thread
From: John Gateley @ 2007-12-06 21:32 UTC (permalink / raw)
  To: gcc-help; +Cc: Brian Dessent

On Thu, 06 Dec 2007 12:15:45 -0800
Brian Dessent <brian@dessent.net> wrote:

> John Gateley wrote:
> 
> > I'm looking for 64 bit I/O functions, such as ftruncate or
> > stat/fstat/lstat. Some functions exist in 64 bit versions
> > (such as lseek64), but for others I couldn't find anything.
> > This is using g++ on linux.
> 
> Normally you don't call the 64 bit versions explicitly, you just add
> -D_FILE_OFFSET_BITS=64 to CPPFLAGS and you get the large-file aware
> version of all interfaces without the 64 suffix.
> ...

Thanks very much...

j

-- 
John Gateley <gateley@jriver.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-06 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-06 19:51 64 bit I/O functions (such as stat/ftruncate) John Gateley
2007-12-06 20:15 ` Brian Dessent
2007-12-06 21:32   ` John Gateley
2007-12-06 20:29 ` John (Eljay) Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).