diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-05 12:06:05 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-05 12:06:05 +0200 |
commit | d5f1b1bbe0a881f66b6bb6951fa54e553002c24d (patch) | |
tree | a3da20d19fa86c77e63c08f01d052b196cb1b192 /networking/inetd.c | |
parent | 8507e1f10927bc6498cf38eb8324a53bde8e0a61 (diff) | |
download | busybox-w32-d5f1b1bbe0a881f66b6bb6951fa54e553002c24d.tar.gz busybox-w32-d5f1b1bbe0a881f66b6bb6951fa54e553002c24d.tar.bz2 busybox-w32-d5f1b1bbe0a881f66b6bb6951fa54e553002c24d.zip |
*: add FAST_FUNC to function ptrs where it makes sense
function old new delta
evalcommand 1195 1209 +14
testcmd - 10 +10
printfcmd - 10 +10
echocmd - 10 +10
func_exec 270 276 +6
echo_dg 104 109 +5
store_nlmsg 85 89 +4
pseudo_exec_argv 195 198 +3
dotcmd 287 290 +3
machtime_stream 29 31 +2
discard_stream 24 26 +2
argstr 1299 1301 +2
killcmd 108 109 +1
evalfor 226 227 +1
daytime_stream 43 44 +1
run_list 2544 2543 -1
lookupvar 62 61 -1
ipaddr_modify 1310 1309 -1
...
parse_stream 2254 2245 -9
evalpipe 356 347 -9
collect_if 210 197 -13
read_opt 869 851 -18
handle_dollar 681 658 -23
print_addrinfo 1342 1303 -39
iterate_on_dir 156 59 -97
print_route 1709 1609 -100
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767) Total: -693 bytes
text data bss dec hex filename
841748 467 7872 850087 cf8a7 busybox_old
841061 467 7872 849400 cf5f8 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/inetd.c')
-rw-r--r-- | networking/inetd.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 751010bc8..031edc397 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -239,36 +239,36 @@ typedef struct servtab_t { | |||
239 | #ifdef INETD_BUILTINS_ENABLED | 239 | #ifdef INETD_BUILTINS_ENABLED |
240 | /* Echo received data */ | 240 | /* Echo received data */ |
241 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO | 241 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO |
242 | static void echo_stream(int, servtab_t *); | 242 | static void FAST_FUNC echo_stream(int, servtab_t *); |
243 | static void echo_dg(int, servtab_t *); | 243 | static void FAST_FUNC echo_dg(int, servtab_t *); |
244 | #endif | 244 | #endif |
245 | /* Internet /dev/null */ | 245 | /* Internet /dev/null */ |
246 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD | 246 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD |
247 | static void discard_stream(int, servtab_t *); | 247 | static void FAST_FUNC discard_stream(int, servtab_t *); |
248 | static void discard_dg(int, servtab_t *); | 248 | static void FAST_FUNC discard_dg(int, servtab_t *); |
249 | #endif | 249 | #endif |
250 | /* Return 32 bit time since 1900 */ | 250 | /* Return 32 bit time since 1900 */ |
251 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_TIME | 251 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_TIME |
252 | static void machtime_stream(int, servtab_t *); | 252 | static void FAST_FUNC machtime_stream(int, servtab_t *); |
253 | static void machtime_dg(int, servtab_t *); | 253 | static void FAST_FUNC machtime_dg(int, servtab_t *); |
254 | #endif | 254 | #endif |
255 | /* Return human-readable time */ | 255 | /* Return human-readable time */ |
256 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME | 256 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME |
257 | static void daytime_stream(int, servtab_t *); | 257 | static void FAST_FUNC daytime_stream(int, servtab_t *); |
258 | static void daytime_dg(int, servtab_t *); | 258 | static void FAST_FUNC daytime_dg(int, servtab_t *); |
259 | #endif | 259 | #endif |
260 | /* Familiar character generator */ | 260 | /* Familiar character generator */ |
261 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN | 261 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN |
262 | static void chargen_stream(int, servtab_t *); | 262 | static void FAST_FUNC chargen_stream(int, servtab_t *); |
263 | static void chargen_dg(int, servtab_t *); | 263 | static void FAST_FUNC chargen_dg(int, servtab_t *); |
264 | #endif | 264 | #endif |
265 | 265 | ||
266 | struct builtin { | 266 | struct builtin { |
267 | /* NB: not necessarily NUL terminated */ | 267 | /* NB: not necessarily NUL terminated */ |
268 | char bi_service7[7]; /* internally provided service name */ | 268 | char bi_service7[7]; /* internally provided service name */ |
269 | uint8_t bi_fork; /* 1 if stream fn should run in child */ | 269 | uint8_t bi_fork; /* 1 if stream fn should run in child */ |
270 | void (*bi_stream_fn)(int, servtab_t *); | 270 | void (*bi_stream_fn)(int, servtab_t *) FAST_FUNC; |
271 | void (*bi_dgram_fn)(int, servtab_t *); | 271 | void (*bi_dgram_fn)(int, servtab_t *) FAST_FUNC; |
272 | }; | 272 | }; |
273 | 273 | ||
274 | static const struct builtin builtins[] = { | 274 | static const struct builtin builtins[] = { |
@@ -1386,7 +1386,7 @@ static const char *const cat_args[] = { "cat", NULL }; | |||
1386 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO | 1386 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO |
1387 | /* Echo service -- echo data back. */ | 1387 | /* Echo service -- echo data back. */ |
1388 | /* ARGSUSED */ | 1388 | /* ARGSUSED */ |
1389 | static void echo_stream(int s, servtab_t *sep UNUSED_PARAM) | 1389 | static void FAST_FUNC echo_stream(int s, servtab_t *sep UNUSED_PARAM) |
1390 | { | 1390 | { |
1391 | #if BB_MMU | 1391 | #if BB_MMU |
1392 | while (1) { | 1392 | while (1) { |
@@ -1407,7 +1407,7 @@ static void echo_stream(int s, servtab_t *sep UNUSED_PARAM) | |||
1407 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ | 1407 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ |
1408 | #endif | 1408 | #endif |
1409 | } | 1409 | } |
1410 | static void echo_dg(int s, servtab_t *sep) | 1410 | static void FAST_FUNC echo_dg(int s, servtab_t *sep) |
1411 | { | 1411 | { |
1412 | enum { BUFSIZE = 12*1024 }; /* for jumbo sized packets! :) */ | 1412 | enum { BUFSIZE = 12*1024 }; /* for jumbo sized packets! :) */ |
1413 | char *buf = xmalloc(BUFSIZE); /* too big for stack */ | 1413 | char *buf = xmalloc(BUFSIZE); /* too big for stack */ |
@@ -1427,7 +1427,7 @@ static void echo_dg(int s, servtab_t *sep) | |||
1427 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD | 1427 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD |
1428 | /* Discard service -- ignore data. */ | 1428 | /* Discard service -- ignore data. */ |
1429 | /* ARGSUSED */ | 1429 | /* ARGSUSED */ |
1430 | static void discard_stream(int s, servtab_t *sep UNUSED_PARAM) | 1430 | static void FAST_FUNC discard_stream(int s, servtab_t *sep UNUSED_PARAM) |
1431 | { | 1431 | { |
1432 | #if BB_MMU | 1432 | #if BB_MMU |
1433 | while (safe_read(s, line, LINE_SIZE) > 0) | 1433 | while (safe_read(s, line, LINE_SIZE) > 0) |
@@ -1446,7 +1446,7 @@ static void discard_stream(int s, servtab_t *sep UNUSED_PARAM) | |||
1446 | #endif | 1446 | #endif |
1447 | } | 1447 | } |
1448 | /* ARGSUSED */ | 1448 | /* ARGSUSED */ |
1449 | static void discard_dg(int s, servtab_t *sep UNUSED_PARAM) | 1449 | static void FAST_FUNC discard_dg(int s, servtab_t *sep UNUSED_PARAM) |
1450 | { | 1450 | { |
1451 | /* dgram builtins are non-forking - DONT BLOCK! */ | 1451 | /* dgram builtins are non-forking - DONT BLOCK! */ |
1452 | recv(s, line, LINE_SIZE, MSG_DONTWAIT); | 1452 | recv(s, line, LINE_SIZE, MSG_DONTWAIT); |
@@ -1467,7 +1467,7 @@ static void init_ring(void) | |||
1467 | } | 1467 | } |
1468 | /* Character generator. MMU arches only. */ | 1468 | /* Character generator. MMU arches only. */ |
1469 | /* ARGSUSED */ | 1469 | /* ARGSUSED */ |
1470 | static void chargen_stream(int s, servtab_t *sep UNUSED_PARAM) | 1470 | static void FAST_FUNC chargen_stream(int s, servtab_t *sep UNUSED_PARAM) |
1471 | { | 1471 | { |
1472 | char *rs; | 1472 | char *rs; |
1473 | int len; | 1473 | int len; |
@@ -1495,7 +1495,7 @@ static void chargen_stream(int s, servtab_t *sep UNUSED_PARAM) | |||
1495 | } | 1495 | } |
1496 | } | 1496 | } |
1497 | /* ARGSUSED */ | 1497 | /* ARGSUSED */ |
1498 | static void chargen_dg(int s, servtab_t *sep) | 1498 | static void FAST_FUNC chargen_dg(int s, servtab_t *sep) |
1499 | { | 1499 | { |
1500 | int len; | 1500 | int len; |
1501 | char text[LINESIZ + 2]; | 1501 | char text[LINESIZ + 2]; |
@@ -1544,14 +1544,14 @@ static uint32_t machtime(void) | |||
1544 | return htonl((uint32_t)(tv.tv_sec + 2208988800)); | 1544 | return htonl((uint32_t)(tv.tv_sec + 2208988800)); |
1545 | } | 1545 | } |
1546 | /* ARGSUSED */ | 1546 | /* ARGSUSED */ |
1547 | static void machtime_stream(int s, servtab_t *sep UNUSED_PARAM) | 1547 | static void FAST_FUNC machtime_stream(int s, servtab_t *sep UNUSED_PARAM) |
1548 | { | 1548 | { |
1549 | uint32_t result; | 1549 | uint32_t result; |
1550 | 1550 | ||
1551 | result = machtime(); | 1551 | result = machtime(); |
1552 | full_write(s, &result, sizeof(result)); | 1552 | full_write(s, &result, sizeof(result)); |
1553 | } | 1553 | } |
1554 | static void machtime_dg(int s, servtab_t *sep) | 1554 | static void FAST_FUNC machtime_dg(int s, servtab_t *sep) |
1555 | { | 1555 | { |
1556 | uint32_t result; | 1556 | uint32_t result; |
1557 | len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len); | 1557 | len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len); |
@@ -1569,14 +1569,14 @@ static void machtime_dg(int s, servtab_t *sep) | |||
1569 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME | 1569 | #if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME |
1570 | /* Return human-readable time of day */ | 1570 | /* Return human-readable time of day */ |
1571 | /* ARGSUSED */ | 1571 | /* ARGSUSED */ |
1572 | static void daytime_stream(int s, servtab_t *sep UNUSED_PARAM) | 1572 | static void FAST_FUNC daytime_stream(int s, servtab_t *sep UNUSED_PARAM) |
1573 | { | 1573 | { |
1574 | time_t t; | 1574 | time_t t; |
1575 | 1575 | ||
1576 | t = time(NULL); | 1576 | t = time(NULL); |
1577 | fdprintf(s, "%.24s\r\n", ctime(&t)); | 1577 | fdprintf(s, "%.24s\r\n", ctime(&t)); |
1578 | } | 1578 | } |
1579 | static void daytime_dg(int s, servtab_t *sep) | 1579 | static void FAST_FUNC daytime_dg(int s, servtab_t *sep) |
1580 | { | 1580 | { |
1581 | time_t t; | 1581 | time_t t; |
1582 | len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len); | 1582 | len_and_sockaddr *lsa = alloca(LSA_LEN_SIZE + sep->se_lsa->len); |