|
Message-ID: <CAKHv7pjymSTNYC0mbQ3+vUxwZNof0nN7oS6gaM4qDT=LPvPDZQ@mail.gmail.com>
Date: Tue, 4 Mar 2014 07:18:05 +0200
From: Paul Schutte <sjpschutte@...il.com>
To: musl@...ts.openwall.com
Subject: Re: stat.h
Hi
Hope I am not too anoying ... ;-)
I have tried both _GNU_SOURCE and _LARGEFILE64_SOURCE and in neither case
do I get a definition for 'struct stat64'
If I understand correctly then source using 'struct stat64' should be fixed
to use 'struct stat' instead ?
If this is not correct, then 'struct stat64' should probably be added to
<sys/stat.h> as only the following are defined there:
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define stat64 stat
#define fstat64 fstat
#define lstat64 lstat
#define fstatat64 fstatat
#define blksize64_t blksize_t
#define blkcnt64_t blkcnt_t
#define ino64_t ino_t
#define off64_t off_t
#endif
Regards
Paul
On Tue, Mar 4, 2014 at 6:20 AM, Rich Felker <dalias@...ifal.cx> wrote:
> On Tue, Mar 04, 2014 at 06:15:01AM +0200, Paul Schutte wrote:
> > Thanks and I agree with padsp being messy.
> >
> > My question really boils down to
> > Should 'struct stat64' be used from within a program and if so, which
> > header file should I include ?
>
> If you want "struct stat64", make sure _GNU_SOURCE or
> _LARGEFILE64_SOURCE is defined before including any system headers
> (best way is with -D_GNU_SOURCE etc. in your CFLAGS) and include
> sys/stat.h. However, it would be better to just use "struct stat",
> etc. (With glibc, you need -D_FILE_OFFSET_BITS=64 in your CFLAGS to
> make this work right; with musl it always works.)
>
> Rich
>
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.