ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/11/01/13:30:06.1

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: =?ISO-8859-1?Q?Hans-Bernhard_Br=F6ker?= <HBBroeker AT t-online DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: _rdtsc(void) inline function in time.h - cause problem with
multiple definition during linking
Date: Mon, 31 Oct 2011 00:22:53 +0100
Lines: 20
Message-ID: <9h64ieF40sU1@mid.dfncis.de>
References: <4ce51722-c2fd-4fe0-8cb9-ebae498c3271 AT r1g2000yqm DOT googlegroups DOT com> <83k47tc9u2 DOT fsf AT gnu DOT org> <CAA2C=vAn=NZYHMCc58HqfNZ=cdVbom-cE4ZZV1Pz=ziTT8EsNA AT mail DOT gmail DOT com> <65da0e3d-29ea-46ae-b23d-ae08652594aa AT a17g2000yqj DOT googlegroups DOT com> <0a80c084-8135-4c4d-a25c-b56f3eb41e36 AT y36g2000yqm DOT googlegroups DOT com> <CAA2C=vBVOTxMEjm4qhRkMZ8oT6VManx6_m30qgpFqzp4Gz=ZEQ AT mail DOT gmail DOT com> <ec1c078d-cb5d-45c0-8c12-491b8ae012ac AT r28g2000yqj DOT googlegroups DOT com> <CAA2C=vC7F7gz+yQg8FpyiPGu1SZCHOYjcnHd2iqa=-Svof2o1g AT mail DOT gmail DOT com> <ef41aea8-5f10-4695-ae05-e43013abca25 AT q16g2000yqn DOT googlegroups DOT com> <CAA2C=vAdrF7ekUek8oqGXJ6espJ4rUikT3H0AY_cA0sTKRzb+A AT mail DOT gmail DOT com> <4EA8D10E DOT 8030200 AT iki DOT fi> <cfac8d8c-7215-46ef-b7de-d88d59fbf2f6 AT x21g2000yqb DOT googlegroups DOT com> <851c9b46-4f07-439f-bd59-a3a7c0c00f39 AT a12g2000vbz DOT googlegroups DOT com>
Mime-Version: 1.0
X-Trace: news.dfncis.de XsFw4dEEbKK8cdn56ysrzgFrRv6Q45Th1jrpK+QRJuTgJqMp/2IzWlyH0F
Cancel-Lock: sha1:0UY8/2rzvOP3EfyThAmX9u23Is4=
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To: <851c9b46-4f07-439f-bd59-a3a7c0c00f39@a12g2000vbz.googlegroups.com>
Bytes: 2590
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 30.10.2011 21:29, RayeR wrote:
> Just a small note to FCNTL.H:
> When I compiled a program (for limnux) using function open() it
> couldn't find
> S_IRUSR and S_IWUSR constants. They are referenced from
[...]
> so I tried to add
> #include<sys/stat.h>
> and then it compiled OK.
> Wouldn't be better to include sys/stat.h directly from FCNTL.H?

May be, but not necessarily.  The relevant specification says that 
<fcntl.h> _may_ pull in <sys/stat.h> --- but not that it has to. 
S_IRUSR and S_IWUSR actually belong into <sys/stat.h>.

So every program that wants to use these macros actually has to include 
<sys/stat.h> to be portable.  In that sense, having <fcntl.h> do it 
might do users a disservice by providing a false feel of correctness --- 
the author of that Linux code you found apparently fell into that trap 
already.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019