FreeBSD is not using <utmp.h> and does not define _PATH_UTMPX.
Tested with busybox applets depending on FEATURE_UTMP (e.g. who, users, etc)
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This patch addressing 2 issues:
1. Replacing source/dest with uh_sport/uh_dport. It seems that uh_* members are
defined on both Linux and BSD, so no #ifdef here
2. Use SOL_IPV6 instead of SOL_RAW on the FreeBSD to fix IPV6_CHECKSUM setsockopt
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
FreeBSD using different constant names, defining them inline
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
<sys/sysmacros.h> is linux-only
FreeBSD defines makedev in sys/types.h already included in the libbb.h.
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
FreeBSD does not use crypt.h, but unistd.h which is already included
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
FreeBSD is not exporting s6_addr32 by default, but has it.
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
FreeBSD uses setpgrp(pid_t, pid_t)
This patch makes crond.c and probably others compilable
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
On FreeBSD getaddrinfo and friends are part of libc.
Other OS-es will also have own dependencies
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Otherwise if $HISTFILE is unset or reassigned, bad things can happen.
function old new delta
ash_main 1210 1218 +8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
If the Range: header is not present it the request,
the offset passed to sendfile is wrong,
and httpd falls back to the read-write loop.
function old new delta
send_file_and_exit 857 865 +8
handle_incoming_and_exit 2239 2230 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 8/-9) Total: -1 bytes
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This lets bb mount build for limited targets without syslog.h,
as long as the parts using it like NFS are disabled.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
It made ^C break out of the entire shell, if we aren't in PS2 mode.
Need a better idea.
function old new delta
expand_one_var 2344 2353 +9
syntax_error_unterm_ch 21 29 +8
parse_dollar 817 824 +7
parse_stream 2251 2238 -13
fgetc_interactive 249 227 -22
syntax_error_unterm_str 26 - -26
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 3/2 up/down: 24/-61) Total: -37 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
If we have a square, the speedup can be extremely large
(in best case example below, it's ~40000 times faster):
$ time ./busybox_old factor 18446743988964486098
18446743988964486098: 2 3037000493 3037000493
real 0m4.246s
$ time ./busybox factor 18446743988964486098
18446743988964486098: 2 3037000493 3037000493
real 0m0.000s
function old new delta
isqrt_odd - 57 +57
print_w - 36 +36
factorize 218 236 +18
print_h - 7 +7
factorize_numstr 65 72 +7
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 2/0 up/down: 125/0) Total: 125 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>