move msghdr and cmsghdr out of bits/socket.h
[musl.git] / src / env / __stack_chk_fail.c
blobe32596d10fff84a89a73cab4c0d84c26101769af
1 #include <string.h>
2 #include <stdint.h>
3 #include "pthread_impl.h"
5 uintptr_t __stack_chk_guard;
7 void __init_ssp(void *entropy)
9 if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
10 else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
12 __pthread_self()->CANARY = __stack_chk_guard;
15 void __stack_chk_fail(void)
17 a_crash();
20 hidden void __stack_chk_fail_local(void);
22 weak_alias(__stack_chk_fail, __stack_chk_fail_local);