This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/patch] New iteration at fixing 9533

Nathan Myers wrote:

"S_ISREG(m)" is the preferred interface.  When S_ISREG isn't defined,
you have to use "(S_IFREG & (m))" instead.  An expression "S_IFREG(m)"
would expand to "0100000(m)", a syntax error.  Of course you haven't
seen this, because where you test, you have had S_ISREG() defined.

Ah, ok, but you didn't tell me about this before!
If AC_DEFINE actually supports the syntax you suggested


it's easy, but I'm not sure. Are you?

BTW, Stevens seems to suggest that some targets have <ioctl.h> but
not <sys/ioctl.h>.  Sorry to be a pest.

Well, you are welcome, but then please be a pest also with the libjava people not only with me! ;)
See, e.g., libjava/java/net/

 The problem is that this
sort of thing would not show up in testing; instead, ./configure
would just not find FIONREAD, then.

What has configure to do with FIONREAD???
Configure looks for sys/ioctl.h and sys/filio.h. Then this code:

#define BSD_COMP /* Get FIONREAD on Solaris2. */
#include <sys/ioctl.h>

// Pick up FIONREAD on Solaris 2.5.
#include <sys/filio.h>

includes the correct header. Below:

// Pipes and sockets. int __num = 0;
int __r = ioctl(this->fd(), FIONREAD, &__num);
if (!__r && __num >= 0)
return __num; #endif

if FIONREAD is not defined, there is no ioctl call at all!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]