aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-07-27 13:53:39 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-28 15:39:26 +0200
commitbe366e5afac1d9f5b3958bd3899a389308d5d9d3 (patch)
tree60c41a15eed758d0cee5a637c063fe53eff36046 /include/platform.h
parent619d9b5e6848a72350126ea9c1e413fd133181e3 (diff)
downloadbusybox-w32-be366e5afac1d9f5b3958bd3899a389308d5d9d3.tar.gz
busybox-w32-be366e5afac1d9f5b3958bd3899a389308d5d9d3.tar.bz2
busybox-w32-be366e5afac1d9f5b3958bd3899a389308d5d9d3.zip
ash: support platforms that don't have '%m' printf specifier
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>
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h
index ea49c7e92..b81c59d4e 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -406,6 +406,7 @@ typedef unsigned smalluint;
406#define HAVE_MNTENT_H 1 406#define HAVE_MNTENT_H 1
407#define HAVE_NET_ETHERNET_H 1 407#define HAVE_NET_ETHERNET_H 1
408#define HAVE_SYS_STATFS_H 1 408#define HAVE_SYS_STATFS_H 1
409#define HAVE_PRINTF_PERCENTM 1
409 410
410#if defined(__UCLIBC__) 411#if defined(__UCLIBC__)
411# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32) 412# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
@@ -461,6 +462,7 @@ typedef unsigned smalluint;
461# undef HAVE_DPRINTF 462# undef HAVE_DPRINTF
462# undef HAVE_UNLOCKED_STDIO 463# undef HAVE_UNLOCKED_STDIO
463# undef HAVE_UNLOCKED_LINE_OPS 464# undef HAVE_UNLOCKED_LINE_OPS
465# undef HAVE_PRINTF_PERCENTM
464#endif 466#endif
465 467
466#if defined(__dietlibc__) 468#if defined(__dietlibc__)
@@ -483,6 +485,7 @@ typedef unsigned smalluint;
483# undef HAVE_STRVERSCMP 485# undef HAVE_STRVERSCMP
484# undef HAVE_XTABS 486# undef HAVE_XTABS
485# undef HAVE_UNLOCKED_LINE_OPS 487# undef HAVE_UNLOCKED_LINE_OPS
488# undef HAVE_PRINTF_PERCENTM
486# include <osreldate.h> 489# include <osreldate.h>
487# if __FreeBSD_version < 1000029 490# if __FreeBSD_version < 1000029
488# undef HAVE_STRCHRNUL /* FreeBSD added strchrnul() between 1000028 and 1000029 */ 491# undef HAVE_STRCHRNUL /* FreeBSD added strchrnul() between 1000028 and 1000029 */
@@ -517,6 +520,7 @@ typedef unsigned smalluint;
517# undef HAVE_STRVERSCMP 520# undef HAVE_STRVERSCMP
518# undef HAVE_UNLOCKED_LINE_OPS 521# undef HAVE_UNLOCKED_LINE_OPS
519# undef HAVE_NET_ETHERNET_H 522# undef HAVE_NET_ETHERNET_H
523# undef HAVE_PRINTF_PERCENTM
520#endif 524#endif
521 525
522/* 526/*