Re: epoll_create1() available in C, not C++ (on alpha)?
On 05/01/12 17:52, Steve M. Robbins wrote: Hi, 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. Steve, thanks for caring enough about Alpha to follow that one up. I had noted the absence of the epoll_create1 routine but other matters have occupied my time recently. Cheers Michael. -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4f0e08f7.20...@orcon.net.nz
epoll_create1() available in C, not C++ (on alpha)?
Howdy, I'm investigating #653441, a build failure that exists only for Alpha. The C++ code in question uses epoll_create1(). 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. However, if I compile using g++, the amd64 works, but alpha says: (sid)smr@albeniz:~$ g++ try-epoll.c try-epoll.c: In function -F¡int main(int, char**)¢:-A try-epoll.c:5: error: -F¡epoll_create1¢ was not declared in this scope-A What's the solution? Is there a bug in alpha's libc6.1-dev (source of epoll.h)? Thanks, -Steve signature.asc Description: Digital signature
Re: epoll_create1() available in C, not C++ (on alpha)?
Hi, 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; On AMD: /* 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: http://www.cygwin.com/ml/libc-ports/2011-09/msg00017.html -Steve signature.asc Description: Digital signature