aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ash: improve signal handlingRon Yorston2021-09-211-1/+0
| | | | | | | | | | | | Allow waitpid() to detect SIGTERM/SIGKILL by checking the (Windows) status returned by GetExitCodeProcess() and updating the Unix status to suit. This allows ash to detect when a process has been 'signalled'. Provide our own implementation of strsignal(3) which returns expanded text for SIGTERM/SIGKILL. Costs 192 bytes.
* win32: let virtual /dev/fd/<num> files be openedRon Yorston2021-06-071-0/+2
| | | | Add support for virtual /dev/fd files to represent file descriptors.
* Merge branch 'busybox' into mergeRon Yorston2021-05-141-0/+5
|\
| * libbb.h: inline byteswapsDenys Vlasenko2021-04-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta recv_and_process_peer_pkt 2173 2245 +72 machtime_dg 97 114 +17 machtime_stream 29 45 +16 fmt_time_bernstein_25 132 139 +7 aesgcm_GHASH 183 184 +1 dumpleases_main 519 516 -3 __bswap_32 3 - -3 udhcp_run_script 743 739 -4 tls_xread_record 634 630 -4 select_lease_time 56 52 -4 rdate_main 260 256 -4 get_prefix 327 323 -4 udhcp_listen_socket 185 180 -5 sha1_process_block64 361 356 -5 sendping6 81 76 -5 sendping4 107 102 -5 read32 27 22 -5 ll_proto_a2n 112 107 -5 bb_lookup_port 102 97 -5 udhcpc_main 2615 2609 -6 tftpd_main 579 573 -6 str2sockaddr 558 552 -6 GMULT 136 130 -6 sha1_end 73 66 -7 ntpd_main 1361 1354 -7 ntohl 7 - -7 inet_addr_match 93 86 -7 htonl 7 - -7 do_iplink 1259 1252 -7 do_add_or_delete 1138 1131 -7 create_and_bind_or_die 117 110 -7 bind_for_passive_mode 124 117 -7 xconnect_ftpdata 98 90 -8 rpm_getint 118 110 -8 read_leases 304 296 -8 read_config 216 208 -8 udhcp_send_kernel_packet 336 327 -9 udhcp_recv_kernel_packet 143 134 -9 sha256_process_block64 451 442 -9 d6_send_kernel_packet_from_client_data_ifindex 275 266 -9 write_leases 215 205 -10 wget_main 2518 2508 -10 udhcpd_main 1528 1518 -10 tftp_protocol 2019 2009 -10 ftpd_main 2159 2149 -10 des_crypt 1318 1308 -10 send_ACK 138 127 -11 ipaddr_modify 1618 1607 -11 udhcp_str2optset 650 638 -12 init_d6_packet 115 103 -12 xwrite_encrypted 512 499 -13 tls_handshake 2060 2047 -13 pscan_main 607 594 -13 perform_d6_release 240 227 -13 ip_port_str 135 122 -13 handle_incoming_and_exit 2230 2217 -13 INET_setroute 751 737 -14 traceroute_init 1153 1137 -16 nc_main 1055 1039 -16 udhcp_init_header 92 75 -17 volume_id_probe_hfs_hfsplus 512 494 -18 send_offer 455 435 -20 do_lzo_decompress 507 487 -20 add_client_options 229 209 -20 ipcalc_main 554 533 -21 dhcprelay_main 966 943 -23 change_listen_mode 345 321 -24 send_packet 188 162 -26 static.xmalloc_optname_optval 709 681 -28 rpm_gettags 447 419 -28 machtime 28 - -28 catcher 299 270 -29 sfp_to_d 78 48 -30 reread_config_file 917 886 -31 lfp_to_d 84 51 -33 udhcp_recv_raw_packet 594 559 -35 nbdclient_main 1182 1145 -37 d_to_lfp 137 100 -37 lzo_compress 567 529 -38 d6_recv_raw_packet 299 254 -45 d_to_sfp 133 85 -48 d6_send_raw_packet_from_client_data_ifindex 427 379 -48 common_ping_main 1935 1887 -48 udhcp_send_raw_packet 467 416 -51 zcip_main 1219 1160 -59 udhcpc6_main 2636 2568 -68 do_lzo_compress 327 258 -69 send_arp_request 201 129 -72 common_traceroute_main 1699 1621 -78 arpping 523 437 -86 arping_main 1597 1481 -116 print_tunnel 678 550 -128 dnsd_main 1304 1164 -140 parse_args 1370 1169 -201 ------------------------------------------------------------------------------ (add/remove: 0/6 grow/shrink: 5/85 up/down: 113/-2246) Total: -2133 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * platform.h: fix for Bionic >= 21 not having wait3()Denys Vlasenko2021-04-141-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Post-merge build fixesRon Yorston2021-03-011-0/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2021-03-011-0/+8
|\|
| * ash: placate -Werror=format-securityDenys Vlasenko2021-02-181-0/+8
| | | | | | | | | | | | | | | | | | | | "In function 'sprint_status48': error: format not a string literal and no format arguments" function old new delta sprint_status48 160 158 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: fixes to build on Windows/MSYS2/mingw-w64Ron Yorston2021-02-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | To investigate GitHub issue #200 it was necessary to perform build on Window using the MSYS2/mingw-w64 toolchain. This threw up some issues: - The settings for _WIN32_WINNT and __USE_MINGW_ANSI_STDIO differ from those in Fedora resulting in compiler errors and warnings. Force the defaults I'm used to. - The workaround to allow native compilation of mconf.c was broken by a subsequent upstream change. Make it work again.
* | Merge branch 'busybox' into mergeRon Yorston2021-01-141-1/+3
|\|
| * Fix bb_setpgrp weapper on the FreeBSDAlex Samorukov2021-01-041-1/+1
| | | | | | | | | | | | | | | | 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>
| * decrease paddign: gcc-9.3.1 slaps 32-byte alignment on arrays willy-nillyDenys Vlasenko2020-11-301-0/+2
| | | | | | | | | | | | | | | | text data bss dec hex filename 1021988 559 5052 1027599 fae0f busybox_old 1021236 559 5052 1026847 fab1f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-07-091-0/+4
|\|
| * randomconfig fixDenys Vlasenko2020-06-231-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-11-281-0/+5
|\|
| * tls: code shrinkDenys Vlasenko2018-11-231-0/+5
| | | | | | | | | | | | | | function old new delta xwrite_encrypted 599 585 -14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | platform.h: remove obsolete #defineRon Yorston2018-11-271-1/+0
| |
* | win32: import fsync(2) implementation from gnulibRon Yorston2018-02-211-0/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2017-08-221-0/+5
|\|
| * Hopefully fix "will break strict-aliasing rules" warning for get_le32Denys Vlasenko2017-08-101-0/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | platform.h: WIN32 doesn't support '%m' printf specifierRon Yorston2017-07-291-0/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2017-07-291-0/+11
|\|
| * ash: support platforms that don't have '%m' printf specifierRon Yorston2017-07-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '%m' conversion specifier prints an error message based on the current value of 'errno'. It is available in the GNU C library, Cygwin (since 2012), uClibc and musl. It is not available in various BSDs, BSD-derived systems (MacOS, Android) or Microsoft Windows. Use a symbol defined in platform.h to control how error messages can be formatted to display the 'errno' message. On platforms that support it use '%m'; on other platforms use '%s' and strerror(). On platforms that have '%m' there is essentially no change in the size of the binary. Otherwise: function old new delta redirect 1287 1310 +23 xtcsetpgrp 27 44 +17 dup2_or_raise 34 51 +17 setinputfile 267 275 +8 .rodata 163379 163371 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 65/-8) Total: 57 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: less hackish implementation of evaltreenr()Denys Vlasenko2017-07-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Defining a function alias with __attribute__ ((alias("evaltree"),__noreturn__)) is not that usual, and clang had a bug which made it misunderstand this construct. Switch to: ALWAYS_INLINE NORETURN evaltreenr() { evaltree(); unreachable(); } Older gcc's do not know unreachable(), on them we pay the price of having a few extra calls to abort(): function old new delta evalsubshell 151 156 +5 evalpipe 357 362 +5 argstr 1141 1144 +3 On newer gcc, code size does not change. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-181-0/+6
|\|
| * Move get_unaligned_le32() macros to platform.hDenys Vlasenko2017-07-151-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-5/+10
|\|
| * Allow FAST_FUNC to be overridden at build timeKang-Che Sung2017-01-091-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Busybox uses FAST_FUNC macro to tweak with IA-32 calling conventions in order to make the function call slightly smaller or slightly faster. However, when I experiment with GCC's LTO (Link Time Optimization), I discovered that FAST_FUNC could hinder LTO's optimization so that the resulting executable become a few bytes larger (than what is compiled without FAST_FUNC). This change allows to specify e.g. CONFIG_EXTRA_CFLAGS="-DFAST_FUNC= -flto" and compile with LTO without a source code hack. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-02-221-1/+5
|\|
| * include/platform.h: Remove extra #endif introduced in 6df9612.Ari Sundholm2015-12-171-1/+0
| | | | | | | | | | | | | | It causes the compilation to fail. Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * Resolve linker issues with Android API 21 (dprintf, tcdrain)Chris Renshaw2015-12-171-1/+6
| | | | | | | | | | Signed-off-by: Chris Renshaw <osm0sis@outlook.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeFRPRon Yorston2015-05-181-3/+17
|\|
| * Conditionalize Bionic workarounds on __ANDROID_API__Matt Whitlock2015-05-031-4/+10
| | | | | | | | | | Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Bionic lacks mempcpy; enable existing workaroundMatt Whitlock2015-05-031-0/+1
| | | | | | | | | | Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Bionic lacks ttyname_r; provide a workaroundMatt Whitlock2015-04-251-0/+7
| | | | | | | | | | Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-03-141-0/+17
|\| | | | | | | | | | | Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
| * gzip: speed up and shrink put_16bit()Denys Vlasenko2015-02-021-0/+2
| | | | | | | | | | | | | | function old new delta put_16bit 104 98 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * platform.h: enable mempcpy for FreeBSDDenys Vlasenko2015-02-021-1/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * platform.h: mempcpy needs <string.h>Denys Vlasenko2015-01-291-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * platform.h: add compat mempcpyDenys Vlasenko2015-01-251-0/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Changes to allow building with MinGW-w64Ron Yorston2015-01-051-0/+2
| |
* | Merge branch 'busybox' into mergeRon Yorston2014-06-301-0/+3
|\|
| * Rename INIT_LAST to INIT_FUNC to avoid confusionBartosz Golaszewski2014-06-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * unit-tests: implement the unit-testing frameworkBartosz Golaszewski2014-06-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2014-05-061-2/+14
|\| | | | | | | | | | | | | Conflicts: debianutils/which.c editors/vi.c libbb/executable.c
| * libbb: provide usleep() fallback implementationBernhard Reutner-Fischer2014-04-131-2/+14
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2014-01-131-6/+22
|\| | | | | | | | | | | Conflicts: include/platform.h scripts/basic/fixdep.c
| * Another FreeBSD fix from Matthias AndreeDenys Vlasenko2014-01-081-3/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * platform.h: undef HAVE_STRCHRNUL only on correct versions of FreeBSDDenys Vlasenko2014-01-071-5/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Extend WIN32 statfs to include type, fsid and namelenRon Yorston2014-01-061-1/+0
| |