#define G (*(struct globals*)bb_common_bufsiz1)
void BUG_cpio_globals_too_big(void);
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.owner_ugid.uid = -1L; \
G.owner_ugid.gid = -1L; \
} while (0)
chksum_t chksum_out;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
//#define G (*ptr_to_globals)
//#define INIT_G() do {
// SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
int tagcount;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void extract_cpio(int fd, const char *source_rpm)
{
#define ESC "\033"
#define old_termios_p ((struct termios*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void
onintr(int sig UNUSED_PARAM)
struct winsize w = { 0, 0, 0, 0 };
int ret;
+ INIT_G();
+
/* We use _stderr_ in order to make resize usable
* in shell backticks (those redirect stdout away from tty).
* NB: other versions of resize open "/dev/tty"
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
/* we have to zero it out because of NOEXEC */ \
memset(&G, 0, sizeof(G)); \
} while (0)
dev_t dir_dev;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void print(unsigned long long size, const char *filename)
char **args;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
/* forward declarations */
static VALUE *eval(void);
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
/* we have to zero it out because of NOEXEC */ \
memset(&G, 0, sizeof(G)); \
IF_FEATURE_AUTOWIDTH(G_terminal_width = TERMINAL_WIDTH;) \
#endif
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
G.bytes_per_block = 32; \
} while (0)
bool exitcode;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void tail_xprint_header(const char *fmt, const char *filename)
{
#define names (G.names)
#define cur (G.cur )
#define cmd (G.cmd )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(G)) / sizeof(cmd[0]) - 1 };
#define user_id (G.user_id )
#define signal_nr (G.signal_nr )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
user_id = -1; \
signal_nr = 15; \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
G.sed_cmd_tail = &G.sed_cmd_head; \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
/* we have to zero it out because of NOEXEC */ \
memset(&G, 0, sizeof(G)); \
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
#define max_matches (G.max_matches )
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.eof_str = NULL; /* need to clear by hand because we are NOEXEC applet */ \
IF_FEATURE_XARGS_SUPPORT_REPL_STR(G.repl_str = "{}";) \
IF_FEATURE_XARGS_SUPPORT_REPL_STR(G.eol_ch = '\n';) \
char jiffy_line[COMMON_BUFSIZE];
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void dump_file(FILE *fp, const char *filename)
{
struct termios tty_attrs;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#if ENABLE_FEATURE_NOLOGIN
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.log_level = 8; \
G.crontab_dir_name = CRONTABS; \
} while (0)
#define base (G.base )
#define stack (G.stack )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
base = 10; \
} while (0)
#define hwif_ctrl (G.hwif_ctrl )
#define hwif_irq (G.hwif_irq )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
#define device (G.device )
#define hw_set (G.hw_set )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
device = ""; \
} while (0)
#define brd_recv (G.brd_recv )
#define req_recv (G.req_recv )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
count = -1; \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
/* Moved to main */ \
/*strcpy(G.msg_ok + 4, MSG_OK );*/ \
/*strcpy(G.msg_err + 4, MSG_ERR);*/ \
#define do_continue (G.do_continue )
#define buf (G.buf )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
char *shell;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static const char keywords_up_down[] ALIGN1 =
#define allsock (G.allsock )
#define line (G.line )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
rlim_ofile_cur = OPEN_MAX; \
global_queuelen = 128; \
char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void noresp(int ign UNUSED_PARAM)
{
#define pingaddr (G.pingaddr )
#define rcvd_tbl (G.rcvd_tbl )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
datalen = DEFDATALEN; \
timeout = MAXWAIT; \
#define handle (G.handle )
#define saved_disc (G.saved_disc )
#define saved_state (G.saved_state )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
/*
#define filter_prio (G.filter_prio)
#define filter_proto (G.filter_proto)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
#define env_cur (G.env_cur )
#define env_var (G.env_var )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
cmax = 30; \
env_cur = &env_var[0]; \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.loginpath = "/bin/login"; \
G.issuefile = "/etc/issue.net"; \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
} while (0)
} FIX_ALIASING;
#define dhcprelay_xid_list (*(struct xid_item*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static struct xid_item *xid_add(uint32_t xid, struct sockaddr_in *ip, int client)
{
int num_sockets, max_socket;
uint32_t our_nip;
+ INIT_G();
+
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
server_addr.sin_port = htons(SERVER_PORT);
uint32_t localnet_ip;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
/**
#endif
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static unsigned long long scale(unsigned long d)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
G.mypid = getpid(); \
G.killsig = SIGKILL; \
} while (0)
#define buffer (G.buffer )
#define terminal_width (G.terminal_width )
#define kernel_HZ (G.kernel_HZ )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#if ENABLE_FEATURE_PS_TIME
/* for ELF executables, notes are pushed before environment and args */
#define total_pcpu (G.total_pcpu )
#define line_buf (G.line_buf )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \
} while (0)
#define dir (G.dir )
#define svd (G.svd )
#define INIT_G() do { \
+ setup_common_bufsiz(); \
pidchanged = 1; \
} while (0)
#define logpipe (G.logpipe )
#define pfd (G.pfd )
#define stamplog (G.stamplog )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
static void fatal2_cannot(const char *m1, const char *m2)
{
#define tstart (G.tstart )
#define tnow (G.tnow )
#define svstatus (G.svstatus )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#define str_equal(s,t) (!strcmp((s), (t)))
if test $OLD != $REM; then
echo "Space in _end[] is $REM bytes. Rerun make to use larger COMMON_BUFSIZE."
+else
+ echo "COMMON_BUFSIZE = $REM bytes"
fi
#define G (*(struct globals*)bb_common_bufsiz1)
void BUG_setfiles_globals_too_big(void);
#define INIT_G() do { \
+ setup_common_bufsiz(); \
if (sizeof(G) > COMMON_BUFSIZE) \
BUG_setfiles_globals_too_big(); \
/* memset(&G, 0, sizeof(G)); - already is */ \
#define SMrdn (G.SMrdn)
#define shbuf (G.shbuf)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
memcpy(SMrup, init_sem, sizeof(init_sem)); \
} while (0)
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
+ setup_common_bufsiz(); \
IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.maj = -1;) \
IF_NOT_FEATURE_MDEV_CONF(G.cur_rule.mode = 0660;) \
} while (0)
#define NWORDS 129
#define hdr ((struct swap_header_v1*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
struct BUG_sizes {
char swap_header_v1_wrong[sizeof(*hdr) != (NWORDS * 4) ? -1 : 1];
off_t len;
const char *label = "";
+ INIT_G();
+
opt_complementary = "-1"; /* at least one param */
/* TODO: -p PAGESZ, -U UUID */
getopt32(argv, "L:", &label);
struct termios new_settings;
} FIX_ALIASING;
#define G (*(struct globals*)bb_common_bufsiz1)
-#define INIT_G() ((void)0)
#define initial_settings (G.initial_settings)
#define new_settings (G.new_settings )
#define cin_fileno (G.cin_fileno )
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#define setTermSettings(fd, argp) \
do { \
#endif
#define fslist (G.fslist )
#define getmntent_buf (G.getmntent_buf )
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#if ENABLE_FEATURE_MTAB_SUPPORT
/*
#define save_g_flags() ((void)0)
#define restore_g_flags() ((void)0)
#endif
-#define INIT_G() do { } while (0)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
#define do_swapoff (applet_name[5] == 'f')
#define BUFFER_SIZE 16*1024
#define env ((char **)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
enum {
MAX_ENV = COMMON_BUFSIZE / sizeof(env[0]) - 1,
};
struct sockaddr_nl sa;
int fd;
+ INIT_G();
+
argv++;
// Subscribe for UEVENT kernel messages