Commit Graph

154 Commits

Author SHA1 Message Date
Stephen Heumann
2d16296748 Work around an ORCA/C preprocessor bug that was causing shell conditionals not to work properly.
The bug is that an #if condition may be mis-evaluated if it immediately follows a use of a function-like macro. I also modified a couple other places that could possibly trigger the bug (including a possibly more reliable fix for the instance of this problem I worked around earlier in include/xatonum.h).
2014-12-04 11:42:48 -06:00
Stephen Heumann
62d8398fcf Fix to assign valid pgrps to child processes. On GNO, we can't just use the pid as a pgrp; we must call tcnewpgrp instead. 2014-11-20 17:53:33 -06:00
Stephen Heumann
b3a419646b Changes to handle the use of \r as newline on the IIgs. 2014-11-08 19:58:11 -06:00
Stephen Heumann
cae994bc22 Add an emulation of waitpid that should be better than the one in libc.
In particular, it will buffer information about children other than the one being waited for, so it isn't lost. It can also emulate a non-blocking wait by arranging to interrupt the wait with a signal.
2014-11-07 12:12:18 -06:00
Stephen Heumann
71b8b67d7d Make the "smallint" type "int" instead of "signed char." This works around an apparent compiler bug where a conditional isn't evaluated correctly. 2014-11-06 13:36:41 -06:00
Stephen Heumann
cbdfea4c97 Revise signal handling to work with GNO.
This involved using signal() rather than sigaction(), which GNO doesn't have. signal() doesn't have the signal-blocking feature of sigaction(), but I've tried to emulate it.
2014-11-04 10:45:28 -06:00
Stephen Heumann
d4b2c3ce8b Various changes for GNO and ORCA/C compatibility. 2014-11-02 18:30:31 -06:00
Stephen Heumann
875b1bbd0e More GNO and ORCA/C compatibility fixes.
Everything in the shell directory now compiles.
2014-11-01 18:25:21 -05:00
Stephen Heumann
f6c7fdc027 GNO/ORCA compatiblity: remove final comma in enums, and appropriately define stuff that GNO doesn't have in platform.h. 2014-11-01 14:22:47 -05:00
Stephen Heumann
8f6869ae25 Miscellaneous changes for ORCA/C and GNO compatibility, mainly removing C99isms.
At this point, ORCA/C can process the main header files, and some smaller source files compile without errors.
2014-11-01 09:46:02 -05:00
Stephen Heumann
6c2c9d8865 Get rid of long longs in the the hush code (but not yet in the libraries) 2014-10-27 14:09:00 -05:00
Bartosz Golaszewski
bf0f2c7aa6 Rename INIT_LAST to INIT_FUNC to avoid confusion
We don't have an INIT_FIRST, so let's rename INIT_LAST to INIT_FUNC
to imply that the function is called at program start-up.

Also: the priority argument for __attribute__((constructor)) isn't
used, so let's remove it.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-30 16:26:57 +02:00
Bartosz Golaszewski
3ed81cf052 unit-tests: implement the unit-testing framework
This set of patches adds a simple unit-testing framework to Busybox

unit-tests: add some helper macros for unit-test framework implementation
unit-tests: implement the unit-testing framework
unit-tests: add basic documentation on writing the unit test cases
unit-tests: modify the Makefile 'test' target to run unit-tests too
unit-tests: add two example test cases
unit-tests: modify the existing strrstr test code to use the unit-test framework

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-22 16:30:41 +02:00
Bernhard Reutner-Fischer
ad16741ccd libbb: provide usleep() fallback implementation
POSIX.1-2008 removed the usleep function, provide a fallback
implementaion using the recommended nanosleep().

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-04-13 16:37:57 +02:00
Denys Vlasenko
8e0ad2647a Another FreeBSD fix from Matthias Andree
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-08 15:10:54 +01:00
Denys Vlasenko
432fbd7a1a platform.h: undef HAVE_STRCHRNUL only on correct versions of FreeBSD
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-07 14:09:47 +01:00
Daniel Borca
d9fc4d8f92 platform: strchrnul is missing if __APPLE__
Signed-off-by: Daniel Borca <dborca@yahoo.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-27 00:27:46 +01:00
Denys Vlasenko
1f5e81f8f8 md5/sha512: a better fix for strict aliasing warnings
The locations *are* well-aligned for direct stores
on any architecture.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-27 01:03:19 +02:00
Mike Frysinger
445e7543e8 platform: use KERNEL_VERSION to simplify uClibc version checking
This makes reading the logic (as well as adding new code) a lot simpler,
and fixes one or two cases that were broken due to incorrect sub-version
tests.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-03-12 11:13:22 -04:00
Denys Vlasenko
e3e321682c Fix move_to_unaligned16
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-27 15:49:38 +01:00
Lauri Kasanen
b8173b603f sha3sum: new applet
function                                             old     new   delta
KeccakF                                                -     496    +496
KeccakF_RoundConstants                                 -     192    +192
sha3_hash                                              -     171    +171
sha3_end                                               -      40     +40
hash_file                                            274     299     +25
KeccakF_RotationConstants                              -      25     +25
KeccakF_PiLane                                         -      25     +25
packed_usage                                       29213   29232     +19
sha3_begin                                             -      18     +18
KeccakF_Mod5                                           -      10     +10
applet_names                                        2445    2453      +8
applet_main                                         1420    1424      +4
applet_nameofs                                       710     712      +2
------------------------------------------------------------------------------
(add/remove: 8/0 grow/shrink: 9/7 up/down: 1049/-54)         Total: ~995 bytes

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-14 05:20:50 +01:00
Denys Vlasenko
2ffd710656 platform.h: disable ALIGNn macros for s390[x]
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-08-06 17:17:15 +02:00
Tias Guns
3645195377 platform.h: Android tweaks: ioprio defines, BB_ADDITIONAL_PATH
Signed-off-by: Tias Guns <tias@ulyssis.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-10 14:26:32 +02:00
Denys Vlasenko
a76dd50ce1 Move Adroid endgrent() and endpwent() NOPS to libbb.h
They should be after includes of pwd.h and grp.h

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-08 16:11:38 +01:00
Denys Vlasenko
6b64a26976 platform.h: define endgrent() and endpwent() as no-ops on Android
Surprisingly, bionic libc seems to lack these functions.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-06 16:23:18 +01:00
Oliver Metz
cc87588a61 disable strverscmp usage if we build against uClibc-0.9.31
Signed-off-by: Oliver Metz <oliver.metz@googlemail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-09 02:08:42 +02:00
Denys Vlasenko
e0894f567a Android build fixes and alternate (hopefully simpler) defconfig for it
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-09 18:00:44 +02:00
Matthias Andree
1285437217 Fixes for FreeBSD build
Signed-off-by: Matthias Andree <mandree@freebsd.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-08-28 05:05:02 +02:00
Denys Vlasenko
14bd16ac56 more tweak for bionic
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 08:49:40 +02:00
Denys Vlasenko
4dc35fb5b6 platform.h: tweaks for cygwin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 04:41:38 +02:00
Dan Fandrich
75214cfe00 Use the _unlocked stdio macros only when they're all available
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-30 02:59:17 +02:00
Dan Fandrich
0e79e7bb42 Use the built-in getline on more systems that don't have it
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-30 02:11:49 +02:00
Timo Teras
0a5b310067 platform.c: provide getline implementation
Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-29 02:19:58 +02:00
Denys Vlasenko
1e18a01fa2 ls: fix HAVE_STRVERSCMP check; add check for older uclibc versions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-21 17:12:52 +02:00
Denys Vlasenko
561f9c8585 Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-21 16:38:29 +02:00
Dan Fandrich
f533ec8767 *: simplify Ethernet header includes
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-10 05:17:59 +02:00
Dan Fandrich
71d7313625 platform.h: support for build under Android
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-03 20:51:58 +02:00
Denys Vlasenko
89f5bfd6c3 libbb.h: use inlined sigfillset, sigemptyset, sigisemptyset on uclibc
text    data     bss     dec     hex filename
 875879     493    7584  883956   d7cf4 busybox_old
 875879     493    7584  883956   d7cf4 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12 23:03:18 +02:00
Denys Vlasenko
47061b4e9b straighten out dprintf/fdprintf mess; remove old "define lchown chown"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-17 23:14:19 +02:00
Dan Fandrich
dc50676cce Move stpcpy replacement function into libbb
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-13 18:37:12 +01:00
Denys Vlasenko
698e8095fa use unistd.h before _POSIX_VERSION
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-08 05:35:04 +01:00
Denys Vlasenko
dd807c16f9 incorporate header fixes proposed in bug 3097
Not sure these are *really* needed, but I suppose they don't hurt

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-02-07 14:58:57 +01:00
Chris Rees
330718ef55 FreeBSD compat
Signed-off-by: Chris Rees <utisoft@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-24 17:07:06 +01:00
Chris Rees
e3c127d846 FreeBSD compat
Signed-off-by: Chris Rees <utisoft@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-24 17:04:59 +01:00
Denys Vlasenko
1f4a987d47 pltaform.h: move include of stdint.h before uint16_t is used
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-22 17:31:35 +01:00
Denys Vlasenko
b40da22357 fix compile error on non-x86 architectures
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-21 01:16:09 +01:00
Chris Rees
9ad97d5041 sighandler_t definition for BSD
Signed-off-by: Chris Rees <utisoft@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-01-20 00:51:52 +01:00
Denys Vlasenko
fb132e4737 whitespace cleanup
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-29 11:46:52 +02:00
Denys Vlasenko
e4dcba1c10 *: whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-28 18:57:19 +02:00
Denys Vlasenko
58647e8f85 Remove check for supported libc.
If it is not supported, it won't work. No need to break working ones
which happen to this over this check.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 03:02:57 +02:00