struct selabel_handle *handle;
};
+// toys/android/log.c
+
+struct log_data {
+ char *tag;
+ char *pri;
+};
+
// toys/example/hello.c
struct hello_data {
long size;
};
+// toys/lsb/hostname.c
+
+struct hostname_data {
+ char *fname;
+};
+
// toys/lsb/killall.c
struct killall_data {
// toys/lsb/md5sum.c
struct md5sum_data {
+ struct arg_list *c;
+
+ int sawline;
+
+ // Crypto variables blanked after summing
unsigned state[5];
unsigned oldstate[5];
uint64_t count;
char *types;
};
+// toys/net/ifconfig.c
+
+struct ifconfig_data {
+ int sockfd;
+};
+
+// toys/net/netcat.c
+
+struct netcat_data {
+ char *filename; // -f read from filename instead of network
+ long quit_delay; // -q Exit after EOF from stdin after # seconds.
+ char *source_address; // -s Bind to a specific source address.
+ long port; // -p Bind to a specific source port.
+ long wait; // -w Wait # seconds for a connection.
+};
+
+// toys/net/netstat.c
+
+struct netstat_data {
+ struct num_cache *inodes;
+ int wpad;
+};;
+
+// toys/net/tunctl.c
+
+struct tunctl_data {
+ char *user;
+};
+
// toys/other/acpi.c
struct acpi_data {
struct base64_data {
long columns;
+
+ unsigned total;
};
// toys/other/blockdev.c
int utc;
};
-// toys/other/ifconfig.c
-
-struct ifconfig_data {
- int sockfd;
-};
-
// toys/other/ionice.c
struct ionice_data {
long mod;
};
-// toys/other/netcat.c
-
-struct netcat_data {
- char *filename; // -f read from filename instead of network
- long quit_delay; // -q Exit after EOF from stdin after # seconds.
- char *source_address; // -s Bind to a specific source address.
- long port; // -p Bind to a specific source port.
- long wait; // -w Wait # seconds for a connection.
-};
-
// toys/other/nsenter.c
struct nsenter_data {
char *console;
};
+// toys/other/setfattr.c
+
+struct setfattr_data {
+ char *x, *v, *n;
+};
+
// toys/other/shred.c
struct shred_data {
struct stat st;
struct statfs sf;
} stat;
- struct passwd *user_name;
- struct group *group_name;
+ char *file, *pattern;
+ int patlen;
};
// toys/other/swapon.c
// toys/other/xxd.c
struct xxd_data {
+ long s;
long g;
long l;
long c;
int sockfd;
};
+// toys/pending/chrt.c
+
+struct chrt_data {
+ long pid;
+};
+
// toys/pending/compress.c
struct compress_data {
// toys/pending/dd.c
struct dd_data {
- int sig;
-};
+ int show_xfer;
+ int show_records;
+ unsigned long long bytes, c_count, in_full, in_part, out_full, out_part;
+ struct timeval start;
+ struct {
+ char *name;
+ int fd;
+ unsigned char *buff, *bp;
+ long sz, count;
+ unsigned long long offset;
+ } in, out;
+};;
// toys/pending/dhcp.c
// toys/pending/expr.c
struct expr_data {
- int argidx;
+ char **tok; // current token, not on the stack since recursive calls mutate it
+
+ char *refree;
};
// toys/pending/fdisk.c
long cylinders;
};
-// toys/pending/file.c
-
-struct file_data {
- int max_name_len;
-};
-
// toys/pending/fold.c
struct fold_data {
char buf[sizeof(struct sockaddr_storage)];
};
+// toys/pending/getfattr.c
+
+struct getfattr_data {
+ char *n;
+};
+
// toys/pending/getty.c
struct getty_data {
// toys/pending/lsof.c
struct lsof_data {
- char *pids;
+ struct arg_list *p;
struct stat *sought_files;
+ struct double_list *all_sockets;
struct double_list *files;
int last_shown_pid;
int shown_header;
int cin_fd;
};
-// toys/pending/netstat.c
-
-struct netstat_data {
- char current_name[21];
- int some_process_unidentified;
-};;
-
// toys/pending/openvt.c
struct openvt_data {
struct sh_data {
char *command;
+
+ long lineno;
};
// toys/pending/sulogin.c
int interval;
};
+// toys/pending/wget.c
+
+struct wget_data {
+ char *filename;
+};
+
// toys/posix/chgrp.c
struct chgrp_data {
struct du_data {
long maxdepth;
- long depth, total;
+ unsigned long depth, total;
dev_t st_dev;
void *inodes;
};
unsigned tabcount, *tab;
};
+// toys/posix/file.c
+
+struct file_data {
+ int max_name_len;
+};
+
// toys/posix/find.c
struct find_data {
unsigned screen_width;
int nl_title;
- char uid_buf[12], gid_buf[12];
+ char *escmore;
};
// toys/posix/mkdir.c
struct arg_list *output_base;
char *address_base;
long max_count;
+ long width;
long jump_bytes;
int address_idx;
unsigned types, leftover, star;
- char *buf;
- uint64_t bufs[4]; // force 64-bit alignment
+ char *buf; // Points to buffers[0] or buffers[1].
+ char *bufs[2]; // Used to detect duplicate lines.
off_t pos;
};
struct patch_data {
char *infile;
long prefix;
+ char *dir;
struct double_list *current_hunk;
long oldline, oldlen, newline, newlen;
struct arg_list *p;
struct arg_list *o;
struct arg_list *k;
+ struct arg_list *O;
} top;
- struct{
+ struct {
char *L;
struct arg_list *G;
struct arg_list *g;
} pgrep;
};
+#ifndef __APPLE__
struct sysinfo si;
+#endif
struct ptr_len gg, GG, pp, PP, ss, tt, uu, UU;
+ struct dirtree *threadparent;
unsigned width, height;
dev_t tty;
void *fields, *kfields;
// toys/posix/wc.c
struct wc_data {
- unsigned long totals[3];
+ unsigned long totals[4];
};
// toys/posix/xargs.c
extern union global_union {
struct getprop_data getprop;
+ struct log_data log;
struct hello_data hello;
struct skeleton_data skeleton;
struct dmesg_data dmesg;
+ struct hostname_data hostname;
struct killall_data killall;
struct md5sum_data md5sum;
struct mknod_data mknod;
struct seq_data seq;
struct su_data su;
struct umount_data umount;
+ struct ifconfig_data ifconfig;
+ struct netcat_data netcat;
+ struct netstat_data netstat;
+ struct tunctl_data tunctl;
struct acpi_data acpi;
struct base64_data base64;
struct blockdev_data blockdev;
struct free_data free;
struct hexedit_data hexedit;
struct hwclock_data hwclock;
- struct ifconfig_data ifconfig;
struct ionice_data ionice;
struct login_data login;
struct losetup_data losetup;
struct mkpasswd_data mkpasswd;
struct mkswap_data mkswap;
struct modinfo_data modinfo;
- struct netcat_data netcat;
struct nsenter_data nsenter;
struct oneit_data oneit;
+ struct setfattr_data setfattr;
struct shred_data shred;
struct stat_data stat;
struct swapon_data swapon;
struct arping_data arping;
struct bootchartd_data bootchartd;
struct brctl_data brctl;
+ struct chrt_data chrt;
struct compress_data compress;
struct crond_data crond;
struct crontab_data crontab;
struct dumpleases_data dumpleases;
struct expr_data expr;
struct fdisk_data fdisk;
- struct file_data file;
struct fold_data fold;
struct fsck_data fsck;
struct ftpget_data ftpget;
+ struct getfattr_data getfattr;
struct getty_data getty;
struct groupadd_data groupadd;
struct host_data host;
struct mke2fs_data mke2fs;
struct modprobe_data modprobe;
struct more_data more;
- struct netstat_data netstat;
struct openvt_data openvt;
struct ping_data ping;
struct route_data route;
struct useradd_data useradd;
struct vi_data vi;
struct watch_data watch;
+ struct wget_data wget;
struct chgrp_data chgrp;
struct chmod_data chmod;
struct cksum_data cksum;
struct du_data du;
struct env_data env;
struct expand_data expand;
+ struct file_data file;
struct find_data find;
struct grep_data grep;
struct head_data head;
GLOBALS(
long maxdepth;
- long depth, total;
+ unsigned long depth, total;
dev_t st_dev;
void *inodes;
)
return 0;
}
- // dirtree callback, comput/display size of node
+ // dirtree callback, compute/display size of node
static int do_du(struct dirtree *node)
{
+ unsigned long blocks;
+
if (!node->parent) TT.st_dev = node->st.st_dev;
else if (!dirtree_notdotdot(node)) return 0;
} else TT.depth--;
}
- node->extra += node->st.st_blocks;
- if (node->parent) node->parent->extra += node->extra;
+ // Modern compilers' optimizers are insane and think signed overflow
+ // behaves differently than unsigned overflow. Sigh. Big hammer.
+ blocks = node->st.st_blocks + (unsigned long)node->extra;
+ node->extra = blocks;
+ if (node->parent)
+ node->parent->extra = (unsigned long)node->parent->extra+blocks;
else TT.total += node->extra;
if ((toys.optflags & FLAG_a) || !node->parent
|| (S_ISDIR(node->st.st_mode) && !(toys.optflags & FLAG_s)))
{
- print(node->extra*512, node);
+ blocks = node->extra;
+ print(blocks*512LL, node);
}
return 0;
// Loop over command line arguments, recursing through children
for (args = toys.optc ? toys.optargs : noargs; *args; args++)
- dirtree_handle_callback(dirtree_start(*args, toys.optflags&(FLAG_H|FLAG_L)),
+ dirtree_flagread(*args, DIRTREE_SYMFOLLOW*!!(toys.optflags&(FLAG_H|FLAG_L)),
do_du);
if (toys.optflags & FLAG_c) print(TT.total*512, 0);