From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4628 Path: news.gmane.org!not-for-mail From: Paul Schutte Newsgroups: gmane.linux.lib.musl.general Subject: Re: stat.h Date: Tue, 4 Mar 2014 07:18:05 +0200 Message-ID: References: <20140303194214.GC7372@port70.net> <20140304042018.GG184@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d56106f041104f3c107b5 X-Trace: ger.gmane.org 1393910292 9642 80.91.229.3 (4 Mar 2014 05:18:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2014 05:18:12 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4632-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 04 06:18:21 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WKhkA-00046i-4r for gllmg-musl@plane.gmane.org; Tue, 04 Mar 2014 06:18:18 +0100 Original-Received: (qmail 21720 invoked by uid 550); 4 Mar 2014 05:18:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21712 invoked from network); 4 Mar 2014 05:18:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XbaA06HK3HSjFdmMCIWtkfQkzOJGfXuJzBYCMheF+rY=; b=aw+BzAIZKXWqOBF+hUwHDxpwG4UJskI6x6KLNq+8cpmfepPk6suDh3u0CrjV3rGBC7 ZXUtDG2mh+qhgezY3SuamUfwSnGPtTfAqXS+V5jCixIL0BRdJll7o+HaFGOlO8NN4Hdt Kh6EnI/YSNtqAV7MjHLoEGkm7pY9J8Ny5AWebu01L9OticBFhasTfG50ndqRXRMQU9AX EfXPc3q8adREv3eksl2JydvTLZcH+7uBrw5f87u5u1gNPSB2An8aVXTmBhICGpm8MH7M R9p2voqXDZDLURzrET6X7r9CSikvvCCnhf3beRg4DJpBpttyWJCuysl7kehivwNyf6/F /7+A== X-Received: by 10.194.21.193 with SMTP id x1mr23562229wje.33.1393910285795; Mon, 03 Mar 2014 21:18:05 -0800 (PST) In-Reply-To: <20140304042018.GG184@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4628 Archived-At: --047d7b5d56106f041104f3c107b5 Content-Type: text/plain; charset=ISO-8859-1 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 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 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 > --047d7b5d56106f041104f3c107b5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi

Hope I am not too anoying .= .. ;-)

I have tried both _GNU_SOURCE and _LARGEFILE64_SOURCE a= nd in neither case do I get a definition for 'struct stat64'
If I understand correctly then source using 'struct stat64&#= 39; 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)
#defi= ne stat64 stat
#define fstat64 fstat
#define lstat64 lstat
#define= fstatat64 fstatat
#define blksize64_t blksize_t
#define blkcnt64_t b= lkcnt_t
#define ino64_t ino_t
#define off64_t off_t
#endif

Regard= s
Paul



On Tue, Mar 4, 2014 at 6:20 AM, Rich = Felker <dalias@aerifal.cx> wrote:
On Tue, Mar 04, 2014 at 06:15:01AM +0200, Pa= ul 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=3D64 in your CFLAGS to
make this work right; with musl it always works.)

Rich

--047d7b5d56106f041104f3c107b5--