system: always support staged sysupgrade
[project/procd.git] / preload.h
1 /*
2  * Copyright (C) 2015 John Crispin <blogic@openwrt.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 2.1
6  * as published by the Free Software Foundation
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13
14 #include <link.h>
15
16 #ifndef __unbounded
17 #define __unbounded
18 #endif
19
20 #ifndef attribute_unused
21 #define attribute_unused __attribute__ ((unused))
22 #endif
23 typedef int (*main_t)(int, char **, char **);
24
25 typedef int (*start_main_t)(main_t main, int, char *__unbounded *__unbounded,
26                         ElfW(auxv_t) *,
27                         __typeof (main),
28                         void (*fini) (void),
29                         void (*rtld_fini) (void),
30                         void *__unbounded stack_end);
31
32 int __libc_start_main(main_t main,
33                         int argc,
34                         char **argv,
35                         ElfW(auxv_t) *auxvec,
36                         __typeof (main) init,
37                         void (*fini) (void),
38                         void (*rtld_fini) (void),
39                         void *stack_end);
40
41
42 typedef void (*uClibc_main)(main_t main,
43                         int argc,
44                         char **argv,
45                         void (*app_init)(void),
46                         void (*app_fini)(void),
47                         void (*rtld_fini)(void),
48                         void *stack_end attribute_unused);
49
50 void __uClibc_main(main_t main,
51                         int argc,
52                         char **argv,
53                         void (*app_init)(void),
54                         void (*app_fini)(void),
55                         void (*rtld_fini)(void),
56                         void *stack_end attribute_unused);