Port NetBSD libc functions to Minix.

This patch contains changes to NetBSD libc code base to make it
compile and work on Minix. Some of them are due to actual NetBSD
libc bugs, as we're compiling it in non-reentrant mode and with
a.out support, something not exactly frequent in NetBSD.
Others are proper fixes to port it to Minix (mostly sa_len
parameter missing in socket and a few mmap from files).
This commit is contained in:
Gianluca Guida
2011-02-15 12:19:40 +00:00
parent 58153774b1
commit ad4dda469f
62 changed files with 730 additions and 72 deletions
+6 -1
View File
@@ -56,24 +56,29 @@ void __guard_setup(void);
void
__guard_setup(void)
{
#ifndef __minix
int mib[2];
#endif
size_t len;
if (__stack_chk_guard[0] != 0)
return;
#ifndef __minix
mib[0] = CTL_KERN;
mib[1] = KERN_ARND;
len = sizeof(__stack_chk_guard);
if (__sysctl(mib, 2, __stack_chk_guard, &len, NULL, 0) == -1 ||
len != sizeof(__stack_chk_guard)) {
#endif
/* If sysctl was unsuccessful, use the "terminator canary". */
((unsigned char *)(void *)__stack_chk_guard)[0] = 0;
((unsigned char *)(void *)__stack_chk_guard)[1] = 0;
((unsigned char *)(void *)__stack_chk_guard)[2] = '\n';
((unsigned char *)(void *)__stack_chk_guard)[3] = 255;
#ifndef __minix
}
#endif
}
/*ARGSUSED*/