This is the mail archive of the
mailing list for the libstdc++ project.
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
AC_DEFINE(_GLIBCPP_S_ISREG_OR_S_IFREG(m), (S_IFREG & (m)))
it's easy, but I'm not sure. Are you?
Well, you are welcome, but then please be a pest also with the libjava
people not only with me! ;)
BTW, Stevens seems to suggest that some targets have <ioctl.h> but
not <sys/ioctl.h>. Sorry to be a pest.
See, e.g., libjava/java/net/natPlainSocketImplPosix.cc.
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. */
// Pick up FIONREAD on Solaris 2.5.
includes the correct header. Below:
// Pipes and sockets.
int __num = 0;
int __r = ioctl(this->fd(), FIONREAD, &__num);
if (!__r && __num >= 0)
if FIONREAD is not defined, there is no ioctl call at all!