summaryrefslogtreecommitdiff
path: root/include/busybox.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 21:38:30 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 21:38:30 +0000
commit335b63d8d1876ce4e172ebcc9d64544785682244 (patch)
tree14183fd728ce51ae10baee70f7d8f72c39d30649 /include/busybox.h
parent07c394e69b0cfa7cd30e97ffc6edb0d857905f45 (diff)
downloadbusybox-w32-335b63d8d1876ce4e172ebcc9d64544785682244.tar.gz
busybox-w32-335b63d8d1876ce4e172ebcc9d64544785682244.tar.bz2
busybox-w32-335b63d8d1876ce4e172ebcc9d64544785682244.zip
make a few struct bb_applet members conditional
rename sllep_and_die -> xfunc_die make fflush_stdout_and_exit NOFORK-safe fix some buglets found by randomconfig
Diffstat (limited to 'include/busybox.h')
-rw-r--r--include/busybox.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/include/busybox.h b/include/busybox.h
index 6f4808778..380de9ab8 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -9,26 +9,35 @@
9 9
10#include "libbb.h" 10#include "libbb.h"
11 11
12#if ENABLE_FEATURE_INSTALLER
12/* order matters: used as index into "install_dir[]" in busybox.c */ 13/* order matters: used as index into "install_dir[]" in busybox.c */
13enum Location { 14typedef enum bb_install_loc_t {
14 _BB_DIR_ROOT = 0, 15 _BB_DIR_ROOT = 0,
15 _BB_DIR_BIN, 16 _BB_DIR_BIN,
16 _BB_DIR_SBIN, 17 _BB_DIR_SBIN,
17 _BB_DIR_USR_BIN, 18 _BB_DIR_USR_BIN,
18 _BB_DIR_USR_SBIN 19 _BB_DIR_USR_SBIN
19}; 20} bb_install_loc_t;
21#endif
20 22
21enum SUIDRoot { 23#if ENABLE_FEATURE_SUID
24typedef enum bb_suid_t {
22 _BB_SUID_NEVER = 0, 25 _BB_SUID_NEVER = 0,
23 _BB_SUID_MAYBE, 26 _BB_SUID_MAYBE,
24 _BB_SUID_ALWAYS 27 _BB_SUID_ALWAYS
25}; 28} bb_suid_t;
29#endif
26 30
27struct BB_applet { 31struct bb_applet {
28 const char *name; 32 const char *name;
29 int (*main) (int argc, char **argv); 33 int (*main) (int argc, char **argv);
30 __extension__ enum Location location:8; 34#if ENABLE_FEATURE_INSTALLER
31 __extension__ enum SUIDRoot need_suid:8; 35 __extension__ enum bb_install_loc_t install_loc:8;
36#endif
37#if ENABLE_FEATURE_SUID
38 __extension__ enum bb_suid_t need_suid:8;
39#endif
40#if ENABLE_FEATURE_EXEC_PREFER_APPLETS
32 /* true if instead if fork(); exec("applet"); waitpid(); 41 /* true if instead if fork(); exec("applet"); waitpid();
33 * one can do fork(); exit(applet_main(argc,argv)); waitpid(); */ 42 * one can do fork(); exit(applet_main(argc,argv)); waitpid(); */
34 unsigned char noexec; 43 unsigned char noexec;
@@ -36,10 +45,11 @@ struct BB_applet {
36 /* true if instead if fork(); exec("applet"); waitpid(); 45 /* true if instead if fork(); exec("applet"); waitpid();
37 * one can simply call applet_main(argc,argv); */ 46 * one can simply call applet_main(argc,argv); */
38 unsigned char nofork; 47 unsigned char nofork;
48#endif
39}; 49};
40 50
41/* Defined in applet.c */ 51/* Defined in applet.c */
42extern const struct BB_applet applets[]; 52extern const struct bb_applet applets[];
43extern const unsigned short NUM_APPLETS; 53extern const unsigned short NUM_APPLETS;
44 54
45#endif /* _BB_INTERNAL_H_ */ 55#endif /* _BB_INTERNAL_H_ */