add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
This commit is contained in:
parent
8d82cf72c9
commit
9b49a5ed85
@ -56,10 +56,13 @@ ifeq ($(CONFIG_DEBUG),y)
|
||||
CFLAGS += $(call cc-option,-g)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
|
||||
# on i386: 14% smaller libbusybox.so
|
||||
# (code itself is 9% bigger, we save on relocs/PLT/GOT)
|
||||
ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
|
||||
CFLAGS += -fpic
|
||||
# and another 4% reduction of libbusybox.so:
|
||||
# (external entry points must be marked EXTERNALLY_VISIBLE)
|
||||
CFLAGS += $(call cc-option,-fvisibility=hidden)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_STATIC),y)
|
||||
|
@ -24,6 +24,6 @@
|
||||
#if ENABLE_BUILD_LIBBUSYBOX
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return libbusybox_main(argc, argv);
|
||||
return lbb_main(argc, argv);
|
||||
}
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@ static void header_verbose_list_ar(const file_header_t *file_header)
|
||||
#define AR_OPT_CREATE 0x20
|
||||
#define AR_OPT_INSERT 0x40
|
||||
|
||||
int ar_main(int argc, char **argv);
|
||||
int ar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int ar_main(int argc, char **argv)
|
||||
{
|
||||
static const char msg_unsupported_err[] ALIGN1 =
|
||||
|
@ -158,7 +158,7 @@ USE_DESKTOP(long long) int unpack_bunzip2(void)
|
||||
return unpack_bz2_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
|
||||
int bunzip2_main(int argc, char **argv);
|
||||
int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int bunzip2_main(int argc, char **argv)
|
||||
{
|
||||
getopt32(argv, "cf");
|
||||
@ -256,7 +256,7 @@ USE_DESKTOP(long long) int unpack_gunzip(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
int gunzip_main(int argc, char **argv);
|
||||
int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int gunzip_main(int argc, char **argv)
|
||||
{
|
||||
getopt32(argv, "cfvdt");
|
||||
@ -294,7 +294,7 @@ USE_DESKTOP(long long) int unpack_unlzma(void)
|
||||
return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
|
||||
int unlzma_main(int argc, char **argv);
|
||||
int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int unlzma_main(int argc, char **argv)
|
||||
{
|
||||
getopt32(argv, "cf");
|
||||
@ -336,7 +336,7 @@ USE_DESKTOP(long long) int unpack_uncompress(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
int uncompress_main(int argc, char **argv);
|
||||
int uncompress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uncompress_main(int argc, char **argv)
|
||||
{
|
||||
getopt32(argv, "cf");
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define CPIO_OPT_CREATE_LEADING_DIR 0x20
|
||||
#define CPIO_OPT_PRESERVE_MTIME 0x40
|
||||
|
||||
int cpio_main(int argc, char **argv);
|
||||
int cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cpio_main(int argc, char **argv)
|
||||
{
|
||||
archive_handle_t *archive_handle;
|
||||
|
@ -1557,7 +1557,7 @@ static void configure_package(deb_file_t *deb_file)
|
||||
set_status(status_num, "installed", 3);
|
||||
}
|
||||
|
||||
int dpkg_main(int argc, char **argv);
|
||||
int dpkg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dpkg_main(int argc, char **argv)
|
||||
{
|
||||
deb_file_t **deb_file = NULL;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define DPKG_DEB_OPT_EXTRACT 8
|
||||
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
|
||||
|
||||
int dpkg_deb_main(int argc, char **argv);
|
||||
int dpkg_deb_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dpkg_deb_main(int argc, char **argv)
|
||||
{
|
||||
archive_handle_t *ar_archive;
|
||||
|
@ -2025,7 +2025,7 @@ USE_DESKTOP(long long) int pack_gzip(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gzip_main(int argc, char **argv);
|
||||
int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int gzip_main(int argc, char **argv)
|
||||
{
|
||||
unsigned opt;
|
||||
|
@ -80,7 +80,7 @@ static void fileaction_dobackup(char *filename, int fileref);
|
||||
static void fileaction_setowngrp(char *filename, int fileref);
|
||||
static void loop_through_files(int filetag, void (*fileaction)(char *filename, int fileref));
|
||||
|
||||
int rpm_main(int argc, char **argv);
|
||||
int rpm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int rpm_main(int argc, char **argv)
|
||||
{
|
||||
int opt = 0, func = 0, rpm_fd, offset;
|
||||
|
@ -49,7 +49,7 @@ static void skip_header(int rpm_fd)
|
||||
}
|
||||
|
||||
/* No getopt required */
|
||||
int rpm2cpio_main(int argc, char **argv);
|
||||
int rpm2cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int rpm2cpio_main(int argc, char **argv)
|
||||
{
|
||||
struct rpm_lead lead;
|
||||
|
@ -769,7 +769,7 @@ static const char tar_longopts[] ALIGN1 =
|
||||
;
|
||||
#endif
|
||||
|
||||
int tar_main(int argc, char **argv);
|
||||
int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tar_main(int argc, char **argv)
|
||||
{
|
||||
char (*get_header_ptr)(archive_handle_t *) = get_header_tar;
|
||||
|
@ -93,7 +93,7 @@ static int unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int unzip_main(int argc, char **argv);
|
||||
int unzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int unzip_main(int argc, char **argv)
|
||||
{
|
||||
zip_header_t zip_header;
|
||||
|
@ -15,7 +15,7 @@ enum {
|
||||
VT_WAITACTIVE = 0x5607 /* wait for vt active */
|
||||
};
|
||||
|
||||
int chvt_main(int argc, char **argv);
|
||||
int chvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int chvt_main(int argc, char **argv)
|
||||
{
|
||||
int fd, num;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int clear_main(int argc, char **argv);
|
||||
int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int clear_main(int argc, char **argv)
|
||||
{
|
||||
return printf("\033[H\033[J") != 6;
|
||||
|
@ -15,7 +15,7 @@
|
||||
/* From <linux/vt.h> */
|
||||
enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
|
||||
|
||||
int deallocvt_main(int argc, char **argv);
|
||||
int deallocvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int deallocvt_main(int argc, char **argv)
|
||||
{
|
||||
/* num = 0 deallocate all unused consoles */
|
||||
|
@ -22,7 +22,7 @@ struct kbentry {
|
||||
#define NR_KEYS 128
|
||||
#define MAX_NR_KEYMAPS 256
|
||||
|
||||
int dumpkmap_main(int argc, char **argv);
|
||||
int dumpkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dumpkmap_main(int argc, char **argv)
|
||||
{
|
||||
struct kbentry ke;
|
||||
|
@ -166,7 +166,7 @@ static void loadnewfont(int fd)
|
||||
do_loadfont(fd, inbuf + offset, unit, 256);
|
||||
}
|
||||
|
||||
int loadfont_main(int argc, char **argv);
|
||||
int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int loadfont_main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
|
@ -25,7 +25,7 @@ struct kbentry {
|
||||
#define NR_KEYS 128
|
||||
#define MAX_NR_KEYMAPS 256
|
||||
|
||||
int loadkmap_main(int argc, char **argv);
|
||||
int loadkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int loadkmap_main(int argc, char **argv)
|
||||
{
|
||||
struct kbentry ke;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int openvt_main(int argc, char **argv);
|
||||
int openvt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int openvt_main(int argc, char **argv)
|
||||
{
|
||||
char vtname[sizeof(VC_FORMAT) + 2];
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int reset_main(int argc, char **argv);
|
||||
int reset_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int reset_main(int argc, char **argv)
|
||||
{
|
||||
if (isatty(1)) {
|
||||
|
@ -20,7 +20,7 @@ onintr(int sig ATTRIBUTE_UNUSED)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int resize_main(int argc, char **argv);
|
||||
int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int resize_main(int argc, char **argv)
|
||||
{
|
||||
struct termios new;
|
||||
|
@ -18,7 +18,7 @@ static const char setconsole_longopts[] ALIGN1 =
|
||||
|
||||
#define OPT_SETCONS_RESET 1
|
||||
|
||||
int setconsole_main(int argc, char **argv);
|
||||
int setconsole_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int setconsole_main(int argc, char **argv)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
@ -20,7 +20,7 @@ enum {
|
||||
KDSETKEYCODE = 0x4B4D /* write kernel keycode table entry */
|
||||
};
|
||||
|
||||
int setkeycodes_main(int argc, char** argv);
|
||||
int setkeycodes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int setkeycodes_main(int argc, char **argv)
|
||||
{
|
||||
int fd, sc;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int setlogcons_main(int argc, char **argv);
|
||||
int setlogcons_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int setlogcons_main(int argc, char **argv)
|
||||
{
|
||||
struct {
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int basename_main(int argc, char **argv);
|
||||
int basename_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int basename_main(int argc, char **argv)
|
||||
{
|
||||
size_t m, n;
|
||||
|
@ -75,7 +75,7 @@ static char *build_row(char *p, unsigned *dp);
|
||||
#define J_WEEK_LEN (WEEK_LEN + 7)
|
||||
#define HEAD_SEP 2 /* spaces between day headings */
|
||||
|
||||
int cal_main(int argc, char **argv);
|
||||
int cal_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cal_main(int argc, char **argv)
|
||||
{
|
||||
struct tm *local_time;
|
||||
|
@ -43,7 +43,7 @@ int bb_cat(char **argv)
|
||||
return retval;
|
||||
}
|
||||
|
||||
int cat_main(int argc, char **argv);
|
||||
int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cat_main(int argc, char **argv)
|
||||
{
|
||||
getopt32(argv, "u");
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int catv_main(int argc, char **argv);
|
||||
int catv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int catv_main(int argc, char **argv)
|
||||
{
|
||||
int retval = EXIT_SUCCESS;
|
||||
|
@ -16,7 +16,7 @@
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
|
||||
int chgrp_main(int argc, char **argv);
|
||||
int chgrp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int chgrp_main(int argc, char **argv)
|
||||
{
|
||||
/* "chgrp [opts] abc file(s)" == "chown [opts] :abc file(s)" */
|
||||
|
@ -67,7 +67,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int chmod_main(int argc, char **argv);
|
||||
int chmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int chmod_main(int argc, char **argv)
|
||||
{
|
||||
int retval = EXIT_SUCCESS;
|
||||
|
@ -61,7 +61,7 @@ static int fileAction(const char *fileName, struct stat *statbuf,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int chown_main(int argc, char **argv);
|
||||
int chown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int chown_main(int argc, char **argv)
|
||||
{
|
||||
int retval = EXIT_SUCCESS;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int chroot_main(int argc, char **argv);
|
||||
int chroot_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int chroot_main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int cksum_main(int argc, char **argv);
|
||||
int cksum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cksum_main(int argc, char **argv)
|
||||
{
|
||||
uint32_t *crc32_table = crc32_filltable(NULL, 1);
|
||||
|
@ -35,7 +35,7 @@ static void writeline(char *line, int class, int flags)
|
||||
fputs(line, stdout);
|
||||
}
|
||||
|
||||
int comm_main(int argc, char **argv);
|
||||
int comm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int comm_main(int argc, char **argv)
|
||||
{
|
||||
#define LINE_LEN 100
|
||||
|
@ -21,7 +21,7 @@
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
|
||||
int cp_main(int argc, char **argv);
|
||||
int cp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cp_main(int argc, char **argv)
|
||||
{
|
||||
struct stat source_stat;
|
||||
|
@ -165,7 +165,7 @@ static void cut_file(FILE * file)
|
||||
|
||||
static const char _op_on_field[] ALIGN1 = " only when operating on fields";
|
||||
|
||||
int cut_main(int argc, char **argv);
|
||||
int cut_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cut_main(int argc, char **argv)
|
||||
{
|
||||
char *sopt, *ltok;
|
||||
|
@ -38,7 +38,7 @@ static void maybe_set_utc(int opt)
|
||||
putenv((char*)"TZ=UTC0");
|
||||
}
|
||||
|
||||
int date_main(int argc, char **argv);
|
||||
int date_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int date_main(int argc, char **argv)
|
||||
{
|
||||
time_t tm;
|
||||
|
@ -73,7 +73,7 @@ static bool write_and_stats(int fd, const void *buf, size_t len, size_t obs,
|
||||
#define XATOU_SFX xatoul_sfx
|
||||
#endif
|
||||
|
||||
int dd_main(int argc, char **argv);
|
||||
int dd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dd_main(int argc, char **argv)
|
||||
{
|
||||
enum {
|
||||
|
@ -29,7 +29,7 @@ static unsigned long kscale(unsigned long b, unsigned long bs)
|
||||
}
|
||||
#endif
|
||||
|
||||
int df_main(int argc, char **argv);
|
||||
int df_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int df_main(int argc, char **argv)
|
||||
{
|
||||
unsigned long blocks_used;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int dirname_main(int argc, char **argv);
|
||||
int dirname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dirname_main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2) {
|
||||
|
@ -78,7 +78,7 @@ static int convert(char *fn, int conv_type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dos2unix_main(int argc, char **argv);
|
||||
int dos2unix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int dos2unix_main(int argc, char **argv)
|
||||
{
|
||||
int o, conv_type;
|
||||
|
@ -140,7 +140,7 @@ static unsigned long du(const char *filename)
|
||||
return sum;
|
||||
}
|
||||
|
||||
int du_main(int argc, char **argv);
|
||||
int du_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int du_main(int argc, char **argv)
|
||||
{
|
||||
unsigned long total;
|
||||
|
@ -119,7 +119,7 @@ int bb_echo(char **argv)
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int echo_main(int argc, char** argv);
|
||||
int echo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int echo_main(int argc, char **argv)
|
||||
{
|
||||
return bb_echo(argv);
|
||||
|
@ -41,7 +41,7 @@ static const char env_longopts[] ALIGN1 =
|
||||
;
|
||||
#endif
|
||||
|
||||
int env_main(int argc, char** argv);
|
||||
int env_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int env_main(int argc, char **argv)
|
||||
{
|
||||
/* cleanenv was static - why? */
|
||||
|
@ -125,7 +125,7 @@ static void unexpand(FILE *file, unsigned int tab_size, unsigned opt)
|
||||
}
|
||||
#endif
|
||||
|
||||
int expand_main(int argc, char **argv);
|
||||
int expand_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int expand_main(int argc, char **argv)
|
||||
{
|
||||
/* Default 8 spaces for 1 tab */
|
||||
|
@ -483,7 +483,7 @@ static VALUE *eval(void)
|
||||
return l;
|
||||
}
|
||||
|
||||
int expr_main(int argc, char **argv);
|
||||
int expr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int expr_main(int argc, char **argv)
|
||||
{
|
||||
VALUE *v;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv);
|
||||
int false_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int false_main(int ATTRIBUTE_UNUSED argc, char ATTRIBUTE_UNUSED **argv)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
|
@ -38,7 +38,7 @@ static int adjust_column(int column, char c)
|
||||
return column;
|
||||
}
|
||||
|
||||
int fold_main(int argc, char **argv);
|
||||
int fold_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int fold_main(int argc, char **argv)
|
||||
{
|
||||
char *line_out = NULL;
|
||||
|
@ -31,7 +31,7 @@ static const struct suffix_mult head_suffixes[] = {
|
||||
|
||||
static const char header_fmt_str[] ALIGN1 = "\n==> %s <==\n";
|
||||
|
||||
int head_main(int argc, char **argv);
|
||||
int head_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int head_main(int argc, char **argv)
|
||||
{
|
||||
unsigned long count = 10;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv);
|
||||
int hostid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int hostid_main(int argc, char ATTRIBUTE_UNUSED **argv)
|
||||
{
|
||||
if (argc > 1) {
|
||||
|
@ -36,7 +36,7 @@ static int printf_full(unsigned int id, const char *arg, const char prefix)
|
||||
return status;
|
||||
}
|
||||
|
||||
int id_main(int argc, char **argv);
|
||||
int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int id_main(int argc, char **argv)
|
||||
{
|
||||
struct passwd *p;
|
||||
|
@ -66,7 +66,7 @@ static void setdefaultfilecon(const char *path)
|
||||
|
||||
#endif
|
||||
|
||||
int install_main(int argc, char **argv);
|
||||
int install_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int install_main(int argc, char **argv)
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int length_main(int argc, char **argv);
|
||||
int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int length_main(int argc, char **argv)
|
||||
{
|
||||
if ((argc != 2) || (**(++argv) == '-')) {
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define LN_BACKUP 8
|
||||
#define LN_SUFFIX 16
|
||||
|
||||
int ln_main(int argc, char **argv);
|
||||
int ln_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int ln_main(int argc, char **argv)
|
||||
{
|
||||
int status = EXIT_SUCCESS;
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int logname_main(int argc, char ATTRIBUTE_UNUSED **argv);
|
||||
int logname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int logname_main(int argc, char ATTRIBUTE_UNUSED **argv)
|
||||
{
|
||||
char buf[128];
|
||||
|
@ -783,7 +783,7 @@ static const unsigned opt_flags[] = {
|
||||
/* THIS IS A "SAFE" APPLET, main() MAY BE CALLED INTERNALLY FROM SHELL */
|
||||
/* BE CAREFUL! */
|
||||
|
||||
int ls_main(int argc, char **argv);
|
||||
int ls_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int ls_main(int argc, char **argv)
|
||||
{
|
||||
struct dnode **dnd;
|
||||
|
@ -77,7 +77,7 @@ static uint8_t *hash_file(const char *filename, hash_algo_t hash_algo)
|
||||
return hash_value;
|
||||
}
|
||||
|
||||
int md5_sha1_sum_main(int argc, char **argv);
|
||||
int md5_sha1_sum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int md5_sha1_sum_main(int argc, char **argv)
|
||||
{
|
||||
int return_value = EXIT_SUCCESS;
|
||||
|
@ -34,7 +34,7 @@ static const char mkdir_longopts[] ALIGN1 =
|
||||
;
|
||||
#endif
|
||||
|
||||
int mkdir_main(int argc, char **argv);
|
||||
int mkdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mkdir_main(int argc, char **argv)
|
||||
{
|
||||
mode_t mode = (mode_t)(-1);
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "libbb.h"
|
||||
#include "libcoreutils/coreutils.h"
|
||||
|
||||
int mkfifo_main(int argc, char **argv);
|
||||
int mkfifo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mkfifo_main(int argc, char **argv)
|
||||
{
|
||||
mode_t mode;
|
||||
|
@ -17,7 +17,7 @@
|
||||
static const char modes_chars[] ALIGN1 = { 'p', 'c', 'u', 'b', 0, 1, 1, 2 };
|
||||
static const mode_t modes_cubp[] = { S_IFIFO, S_IFCHR, S_IFBLK };
|
||||
|
||||
int mknod_main(int argc, char **argv);
|
||||
int mknod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mknod_main(int argc, char **argv)
|
||||
{
|
||||
mode_t mode;
|
||||
|
@ -33,7 +33,7 @@ static const char mv_longopts[] ALIGN1 =
|
||||
static const char fmt[] ALIGN1 =
|
||||
"cannot overwrite %sdirectory with %sdirectory";
|
||||
|
||||
int mv_main(int argc, char **argv);
|
||||
int mv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mv_main(int argc, char **argv)
|
||||
{
|
||||
struct stat dest_stat;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include "libbb.h"
|
||||
|
||||
int nice_main(int argc, char **argv);
|
||||
int nice_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int nice_main(int argc, char **argv)
|
||||
{
|
||||
int old_priority, adjustment;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int nohup_main(int argc, char **argv);
|
||||
int nohup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int nohup_main(int argc, char **argv)
|
||||
{
|
||||
int nullfd;
|
||||
|
@ -156,7 +156,7 @@ static const char od_o2si[] ALIGN1 = {
|
||||
0xb, 1, 8, 9,
|
||||
};
|
||||
|
||||
int od_main(int argc, char **argv);
|
||||
int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int od_main(int argc, char **argv)
|
||||
{
|
||||
int ch;
|
||||
|
@ -1196,7 +1196,7 @@ dump_strings(void)
|
||||
check_and_close();
|
||||
}
|
||||
|
||||
int od_main(int argc, char **argv);
|
||||
int od_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int od_main(int argc, char **argv)
|
||||
{
|
||||
static const struct suffix_mult bkm[] = {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "libbb.h"
|
||||
extern char **environ;
|
||||
|
||||
int printenv_main(int argc, char **argv);
|
||||
int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int printenv_main(int argc, char **argv)
|
||||
{
|
||||
/* no variables specified, show whole env */
|
||||
|
@ -285,7 +285,7 @@ static int print_formatted(char *format, int argc, char **argv)
|
||||
return save_argc - argc;
|
||||
}
|
||||
|
||||
int printf_main(int argc, char **argv);
|
||||
int printf_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int printf_main(int argc, char **argv)
|
||||
{
|
||||
char *format;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int pwd_main(int argc, char **argv);
|
||||
int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int pwd_main(int argc, char **argv)
|
||||
{
|
||||
char *buf;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int readlink_main(int argc, char **argv);
|
||||
int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int readlink_main(int argc, char **argv)
|
||||
{
|
||||
char *buf;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int realpath_main(int argc, char **argv);
|
||||
int realpath_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int realpath_main(int argc, char **argv)
|
||||
{
|
||||
int retval = EXIT_SUCCESS;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int rm_main(int argc, char **argv);
|
||||
int rm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int rm_main(int argc, char **argv)
|
||||
{
|
||||
int status = 0;
|
||||
|
@ -16,7 +16,7 @@
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
|
||||
int rmdir_main(int argc, char **argv);
|
||||
int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int rmdir_main(int argc, char **argv)
|
||||
{
|
||||
int status = EXIT_SUCCESS;
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
|
||||
int seq_main(int argc, char **argv);
|
||||
int seq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int seq_main(int argc, char **argv)
|
||||
{
|
||||
double last, increment, i;
|
||||
|
@ -33,7 +33,7 @@ static const struct suffix_mult sfx[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
int sleep_main(int argc, char **argv);
|
||||
int sleep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int sleep_main(int argc, char **argv)
|
||||
{
|
||||
unsigned duration;
|
||||
|
@ -274,7 +274,7 @@ static unsigned str2u(char **str)
|
||||
}
|
||||
#endif
|
||||
|
||||
int sort_main(int argc, char **argv);
|
||||
int sort_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int sort_main(int argc, char **argv)
|
||||
{
|
||||
FILE *fp, *outfile = stdout;
|
||||
|
@ -55,7 +55,7 @@ enum { READ_BUFFER_SIZE = COMMON_BUFSIZE - 1 };
|
||||
#define SPLIT_OPT_b (1<<1)
|
||||
#define SPLIT_OPT_a (1<<2)
|
||||
|
||||
int split_main(int argc, char **argv);
|
||||
int split_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int split_main(int argc, char **argv)
|
||||
{
|
||||
unsigned suffix_len = 2;
|
||||
|
@ -609,7 +609,7 @@ static bool do_stat(const char *filename, const char *format)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int stat_main(int argc, char **argv);
|
||||
int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int stat_main(int argc, char **argv)
|
||||
{
|
||||
char *format = NULL;
|
||||
|
@ -911,7 +911,7 @@ static void set_control_char_or_die(const struct control_info *info,
|
||||
#define STTY_verbose_output (1<<2)
|
||||
#define STTY_recoverable_output (1<<3)
|
||||
#define STTY_noargs (1<<4)
|
||||
int stty_main(int argc, char **argv);
|
||||
int stty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int stty_main(int argc, char **argv)
|
||||
{
|
||||
struct termios mode;
|
||||
|
@ -74,7 +74,7 @@ static unsigned sum_file(const char *file, const unsigned type)
|
||||
#undef buf
|
||||
}
|
||||
|
||||
int sum_main(int argc, char **argv);
|
||||
int sum_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int sum_main(int argc, char **argv)
|
||||
{
|
||||
unsigned n;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int sync_main(int argc, char **argv);
|
||||
int sync_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int sync_main(int argc, char **argv)
|
||||
{
|
||||
bb_warn_ignoring_args(argc - 1);
|
||||
|
@ -79,7 +79,7 @@ static unsigned eat_num(const char *p)
|
||||
return xatou_sfx(p, tail_suffixes);
|
||||
}
|
||||
|
||||
int tail_main(int argc, char **argv);
|
||||
int tail_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tail_main(int argc, char **argv)
|
||||
{
|
||||
unsigned count = 10;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "libbb.h"
|
||||
#include <signal.h>
|
||||
|
||||
int tee_main(int argc, char **argv);
|
||||
int tee_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tee_main(int argc, char **argv)
|
||||
{
|
||||
const char *mode = "w\0a";
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int touch_main(int argc, char **argv);
|
||||
int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int touch_main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
|
@ -165,7 +165,7 @@ static int complement(char *buffer, int buffer_len)
|
||||
return ix;
|
||||
}
|
||||
|
||||
int tr_main(int argc, char **argv);
|
||||
int tr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tr_main(int argc, char **argv)
|
||||
{
|
||||
unsigned char *ptr;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int true_main(int argc, char **argv);
|
||||
int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int true_main(int argc, char **argv)
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int tty_main(int argc, char **argv);
|
||||
int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tty_main(int argc, char **argv)
|
||||
{
|
||||
const char *s;
|
||||
|
@ -48,7 +48,7 @@ static const unsigned short utsname_offset[] ALIGN2 = {
|
||||
offsetof(uname_info_t,processor)
|
||||
};
|
||||
|
||||
int uname_main(int argc, char **argv);
|
||||
int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uname_main(int argc, char **argv)
|
||||
{
|
||||
uname_info_t uname_info;
|
||||
|
@ -27,7 +27,7 @@ static FILE *xgetoptfile_uniq_s(char **argv, int read0write2)
|
||||
return (read0write2) ? stdout : stdin;
|
||||
}
|
||||
|
||||
int uniq_main(int argc, char **argv);
|
||||
int uniq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uniq_main(int argc, char **argv)
|
||||
{
|
||||
FILE *in, *out;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int usleep_main(int argc, char **argv);
|
||||
int usleep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int usleep_main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2) {
|
||||
|
@ -126,7 +126,7 @@ static void read_base64(FILE *src_stream, FILE *dst_stream)
|
||||
}
|
||||
}
|
||||
|
||||
int uudecode_main(int argc, char **argv);
|
||||
int uudecode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uudecode_main(int argc, char **argv)
|
||||
{
|
||||
FILE *src_stream = stdin;
|
||||
|
@ -15,7 +15,7 @@ enum {
|
||||
DST_BUF_SIZE = 4 * ((SRC_BUF_SIZE + 2) / 3),
|
||||
};
|
||||
|
||||
int uuencode_main(int argc, char **argv);
|
||||
int uuencode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uuencode_main(int argc, char **argv)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
|
@ -68,7 +68,7 @@ enum {
|
||||
WC_LENGTH = 3
|
||||
};
|
||||
|
||||
int wc_main(int argc, char **argv);
|
||||
int wc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int wc_main(int argc, char **argv)
|
||||
{
|
||||
FILE *fp;
|
||||
|
@ -39,7 +39,7 @@ static void idle_string(char *str6, time_t t)
|
||||
strcpy(str6, "old");
|
||||
}
|
||||
|
||||
int who_main(int argc, char **argv);
|
||||
int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int who_main(int argc, char **argv)
|
||||
{
|
||||
char str6[6];
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int whoami_main(int argc, char **argv);
|
||||
int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int whoami_main(int argc, char **argv)
|
||||
{
|
||||
if (argc > 1)
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
int yes_main(int argc, char **argv);
|
||||
int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int yes_main(int argc, char **argv)
|
||||
{
|
||||
char **first_arg;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int mktemp_main(int argc, char **argv);
|
||||
int mktemp_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mktemp_main(int argc, char **argv)
|
||||
{
|
||||
unsigned long flags = getopt32(argv, "dqt");
|
||||
|
@ -14,7 +14,7 @@
|
||||
/* Read a block of data from stdin, write it to stdout.
|
||||
* Activity is indicated by a '.' to stderr
|
||||
*/
|
||||
int pipe_progress_main(int argc, char **argv);
|
||||
int pipe_progress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int pipe_progress_main(int argc, char **argv)
|
||||
{
|
||||
RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE);
|
||||
|
@ -110,7 +110,7 @@ static const char runparts_longopts[] ALIGN1 =
|
||||
;
|
||||
#endif
|
||||
|
||||
int run_parts_main(int argc, char **argv);
|
||||
int run_parts_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int run_parts_main(int argc, char **argv)
|
||||
{
|
||||
const char *umask_p = "22";
|
||||
|
@ -234,7 +234,7 @@ enum {
|
||||
OPT_NICELEVEL = 0x4000 * ENABLE_FEATURE_START_STOP_DAEMON_FANCY, // -N
|
||||
};
|
||||
|
||||
int start_stop_daemon_main(int argc, char **argv);
|
||||
int start_stop_daemon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int start_stop_daemon_main(int argc, char **argv)
|
||||
{
|
||||
unsigned opt;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
int which_main(int argc, char **argv);
|
||||
int which_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int which_main(int argc, char **argv)
|
||||
{
|
||||
int status = EXIT_SUCCESS;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user