[pkg-boost-devel] Bug#653441: epoll_create1() available in C, not C++ (on alpha)?

Steve M. Robbins steve at sumost.ca
Thu Jan 5 04:52:57 UTC 2012


By private mail, I got the suggestion that maybe Alpha's epoll.h lacks
"extern C"; I diff'd the two files and that's not the case.  However,
I did find the following:

On Alpha:

/* Same as epoll_create but with an additional FLAGS parameter.  */
extern int epoll_create2 (int __size, int __flags) __THROW;


/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
   parameter has been dropped.  */
extern int epoll_create1 (int __flags) __THROW;

And, in fact, epoll_create2() does not exist.  I changed the
test code to "... int fd = epoll_create2(0,0);" and the Alpha
machine fails to compile:

gcc try-epoll.c 
/tmp/cckkq2Mc.o: In function `main':
(.text+0x2c): undefined reference to `epoll_create2'

> I've boiled it down to the following test code:
>   #include <sys/epoll.h>
>   int main(int ac, char* av[])
>   {
>       int fd = epoll_create1(0);
>       return 0;
>   }
> This can be successfully compiled using "gcc" on both alpha (tested in sid chroot of albeniz.debian.org) and on my amd64 machine.

It turns out that the only reason it "works" on Alpha is due
to C's rules for implict function definition:

  gcc -Wall try-epoll.c 
  try-epoll.c: In function ~main~:
  try-epoll.c:5: warning: implicit declaration of function ~epoll_create1~

This looks like a bug in glibc, specifically that the following patch
was never applied:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-boost-devel/attachments/20120104/d754656e/attachment-0001.pgp>

More information about the pkg-boost-devel mailing list