Files
zig/lib/libc/musl/src/env/__stack_chk_fail.c
Andrew Kelley 49d1a4c562 move lib dirs to lib subdir
also start prefering NtDll API. so far:
 * NtQueryInformationFile
 * NtClose

adds a performance workaround for windows unicode conversion. but that
should probably be removed before merging
2019-07-15 17:54:50 -04:00

23 lines
463 B
C

#include <string.h>
#include <stdint.h>
#include "pthread_impl.h"
uintptr_t __stack_chk_guard;
void __init_ssp(void *entropy)
{
if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
__pthread_self()->CANARY = __stack_chk_guard;
}
void __stack_chk_fail(void)
{
a_crash();
}
hidden void __stack_chk_fail_local(void);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);