Re: stat64 et al.
On Fri, Feb 09, 2001 at 04:48:50PM +0100, Michael Meskes wrote:
> I'm just working on my stat utility to be able to cope with files > 2GB and
> filesystems > ?TB. While it is no big deal to use stat64() instead of stat()
> but I wonder if there are old system out there that do not have stat64()
> resp. statfs64() in their libc. I would prefer to not use lots of #ifdefs.
> On the other hand I have no idea when these functions were introduced.
>
> I noticed that on sparc the struct statbuf64 is not the same as on i386.
> Some member variables are larger on sparc. Is there any protable way to
> output these variables?
The correct way is to simply add -D_LARGEFILE_SOURCE to your CFLAGS.
Then stat(), open(), et al will all automagically become their 64bit LFS
counterparts. No code changes are required at all.
Ben
--
-----------=======-=-======-=========-----------=====------------=-=------
/ Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
`---=========------=======-------------=-=-----=-===-======-------=--=---'
Reply to: