aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 16:26:30 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-04-21 17:39:11 +0200
commite6a2f4cc5a47d3022bdf5ca2cacbaa5a8c5baf7a (patch)
tree0962142ac9830312cd3df52994db41e8ac47c73c /runit
parent5598bdf0d3d46a865a4d23785e2d09e6db9be420 (diff)
downloadbusybox-w32-e6a2f4cc5a47d3022bdf5ca2cacbaa5a8c5baf7a.tar.gz
busybox-w32-e6a2f4cc5a47d3022bdf5ca2cacbaa5a8c5baf7a.tar.bz2
busybox-w32-e6a2f4cc5a47d3022bdf5ca2cacbaa5a8c5baf7a.zip
libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for it
The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit')
-rw-r--r--runit/runsv.c3
-rw-r--r--runit/runsvdir.c3
-rw-r--r--runit/sv.c3
-rw-r--r--runit/svlogd.c5
4 files changed, 9 insertions, 5 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index 4b18d12d5..8833f4c96 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -45,6 +45,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 45
46#include <sys/file.h> 46#include <sys/file.h>
47#include "libbb.h" 47#include "libbb.h"
48#include "common_bufsiz.h"
48#include "runit_lib.h" 49#include "runit_lib.h"
49 50
50#if ENABLE_MONOTONIC_SYSCALL 51#if ENABLE_MONOTONIC_SYSCALL
@@ -105,7 +106,7 @@ struct globals {
105 char *dir; 106 char *dir;
106 struct svdir svd[2]; 107 struct svdir svd[2];
107} FIX_ALIASING; 108} FIX_ALIASING;
108#define G (*(struct globals*)&bb_common_bufsiz1) 109#define G (*(struct globals*)bb_common_bufsiz1)
109#define haslog (G.haslog ) 110#define haslog (G.haslog )
110#define sigterm (G.sigterm ) 111#define sigterm (G.sigterm )
111#define pidchanged (G.pidchanged ) 112#define pidchanged (G.pidchanged )
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index b3d9e7390..49c8f5b48 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -57,6 +57,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 57
58#include <sys/file.h> 58#include <sys/file.h>
59#include "libbb.h" 59#include "libbb.h"
60#include "common_bufsiz.h"
60#include "runit_lib.h" 61#include "runit_lib.h"
61 62
62#define MAXSERVICES 1000 63#define MAXSERVICES 1000
@@ -84,7 +85,7 @@ struct globals {
84 unsigned stamplog; 85 unsigned stamplog;
85#endif 86#endif
86} FIX_ALIASING; 87} FIX_ALIASING;
87#define G (*(struct globals*)&bb_common_bufsiz1) 88#define G (*(struct globals*)bb_common_bufsiz1)
88#define sv (G.sv ) 89#define sv (G.sv )
89#define svdir (G.svdir ) 90#define svdir (G.svdir )
90#define svnum (G.svnum ) 91#define svnum (G.svnum )
diff --git a/runit/sv.c b/runit/sv.c
index de8a0d8a4..e83a29781 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -189,6 +189,7 @@ Exit Codes
189 189
190#include <sys/file.h> 190#include <sys/file.h>
191#include "libbb.h" 191#include "libbb.h"
192#include "common_bufsiz.h"
192#include "runit_lib.h" 193#include "runit_lib.h"
193 194
194struct globals { 195struct globals {
@@ -199,7 +200,7 @@ struct globals {
199 uint64_t tstart, tnow; 200 uint64_t tstart, tnow;
200 svstatus_t svstatus; 201 svstatus_t svstatus;
201} FIX_ALIASING; 202} FIX_ALIASING;
202#define G (*(struct globals*)&bb_common_bufsiz1) 203#define G (*(struct globals*)bb_common_bufsiz1)
203#define acts (G.acts ) 204#define acts (G.acts )
204#define service (G.service ) 205#define service (G.service )
205#define rc (G.rc ) 206#define rc (G.rc )
diff --git a/runit/svlogd.c b/runit/svlogd.c
index dbe8df65c..09efdb695 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -155,6 +155,7 @@ log message, you can use a pattern like this instead
155 155
156#include <sys/file.h> 156#include <sys/file.h>
157#include "libbb.h" 157#include "libbb.h"
158#include "common_bufsiz.h"
158#include "runit_lib.h" 159#include "runit_lib.h"
159 160
160#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0) 161#define LESS(a,b) ((int)((unsigned)(b) - (unsigned)(a)) > 0)
@@ -1045,9 +1046,9 @@ int svlogd_main(int argc, char **argv)
1045 } 1046 }
1046 if (opt & 2) if (!repl) repl = '_'; // -R 1047 if (opt & 2) if (!repl) repl = '_'; // -R
1047 if (opt & 4) { // -l 1048 if (opt & 4) { // -l
1048 linemax = xatou_range(l, 0, BUFSIZ-26); 1049 linemax = xatou_range(l, 0, COMMON_BUFSIZE-26);
1049 if (linemax == 0) 1050 if (linemax == 0)
1050 linemax = BUFSIZ-26; 1051 linemax = COMMON_BUFSIZE-26;
1051 if (linemax < 256) 1052 if (linemax < 256)
1052 linemax = 256; 1053 linemax = 256;
1053 } 1054 }