libc and header file problems
I discovered some problems with the Minix C library and header files while
porting curl to Minix 3.1.2 using ACK on a 32-bit x86 system. A few
functions found in libc were missing prototypes in header files,
namely recv, send, and strtok_r. A few network functions were found
in the header file <net/gen/inet.h>, which is a bit of an odd place;
the "standard" location on other systems (Linux, FreeBSD, Solaris)
is <arpa/inet.h>.
Finally, sigsetjmp is broken. Any attempt to use it will fail to link
with an undefined symbol __longjmp. Looking through the source shows
that, sure enough, _longjmp is called from siglongjmp but it's never
defined. Here is a test program to demonstrate this problem:
/*
* This program fails to link on Minix 3.1.2 when compiled with ACK with:
* cc -D_POSIX_SOURCE=1 -o jmptst jmptst.c
* Undefined:
* __longjmp
*/
#include <setjmp.h>
#include <stdio.h>
int main(void)
{
sigjmp_buf j;
if (sigsetjmp(j, 0)) {
printf("Got jump\n");
return 0;
}
siglongjmp(j,1);
printf("Error!\n");
return 1;
}
The current daily builds of curl will now compile with gcc on Minix (as
should 7.16.0 when it's released), but until the _longjmp problem is
fixed, it won't on ACK.
[color=blue][color=green][color=darkred]
>>> Dan[/color][/color][/color]
--
[url]http://www.MoveAnnouncer.com[/url] The web change of address service
Let webmasters know that your web site has moved
Re: libc and header file problems
In article <efd24p$qe9@ponderosa.fch.wimsey.bc.ca>,
Dan Fandrich <dan@coneharvesters.com> wrote:[color=blue]
>I discovered some problems with the Minix C library and header files while
>porting curl to Minix 3.1.2 using ACK on a 32-bit x86 system. A few
>functions found in libc were missing prototypes in header files,
>namely recv, send, and strtok_r. A few network functions were found
>in the header file <net/gen/inet.h>, which is a bit of an odd place;
>the "standard" location on other systems (Linux, FreeBSD, Solaris)
>is <arpa/inet.h>.[/color]
The Open Group claims that the prototypes for send() and recv() have to be
in <sys/socket.h>
The current version of Minix 3 (in CVS) has the prototypes and some fixes
for send.
There are many functions missing, and strtok_r is probably one of them.
Port a BSD version and submit it as patch.
[color=blue]
>Finally, sigsetjmp is broken. Any attempt to use it will fail to link
>with an undefined symbol __longjmp. Looking through the source shows
>that, sure enough, _longjmp is called from siglongjmp but it's never
>defined. Here is a test program to demonstrate this problem:[/color]
I think this is also supposed to be fixed in the current version of Minix 3.
For now, just define a function _longjmp somewhere that calls longjmp.
[color=blue]
>The current daily builds of curl will now compile with gcc on Minix (as
>should 7.16.0 when it's released), but until the _longjmp problem is
>fixed, it won't on ACK.[/color]
Setjmp for gcc is broken in 3.1.2a.
--
That was it. Done. The faulty Monk was turned out into the desert where it
could believe what it liked, including the idea that it had been hard done
by. It was allowed to keep its horse, since horses were so cheap to make.
-- Douglas Adams in Dirk Gently's Holistic Detective Agency