libc, libutil: remove compat hacks
[minix.git] / lib / libc / sys-minix / init.c
blob544a60d53f03d5edb847ecd3411139436433bb5c
2 #include <stdio.h>
3 #include <minix/ipc.h>
5 /* Minix kernel info, IPC functions pointers */
6 struct minix_kerninfo *_minix_kerninfo = NULL;
8 void __minix_init(void) __attribute__((__constructor__, __used__));
10 struct minix_ipcvecs _minix_ipcvecs = {
11 .sendrec = _sendrec_orig,
12 .send = _send_orig,
13 .notify = _notify_orig,
14 .senda = _senda_orig,
15 .sendnb = _sendnb_orig,
16 .receive = _receive_orig,
17 .do_kernel_call = _do_kernel_call_orig,
20 void __minix_init(void)
22 if((_minix_kernel_info_struct(&_minix_kerninfo)) != 0
23 || _minix_kerninfo->kerninfo_magic != KERNINFO_MAGIC) {
24 _minix_kerninfo = NULL;
25 } else if((_minix_kerninfo->ki_flags & MINIX_KIF_IPCVECS) &&
26 _minix_kerninfo->minix_ipcvecs) {
27 _minix_ipcvecs = *_minix_kerninfo->minix_ipcvecs;