summaryrefslogtreecommitdiff
path: root/libbb/procps.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bb_getpwuid, bb_getgrgid: change order of arguments to more intuitive one;Denis Vlasenko2007-07-271-2/+3
| | | | | comment thoroughly when they die and when they dont.
* stray trailing tabs removedDenis Vlasenko2007-07-191-2/+2
|
* remove accumulated stray trailing whitespaceDenis Vlasenko2007-07-171-1/+1
|
* top,ps: improve /proc/PID/cmdinfo reading codeDenis Vlasenko2007-06-301-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta display_status - 1231 +1231 read_cmdline - 101 +101 parse_conf 1284 1303 +19 arith 2033 2042 +9 collect_blk 467 474 +7 fsck_main 1909 1911 +2 dhcprelay_main 1125 1122 -3 singlemount 4555 4547 -8 read_close 50 36 -14 get_lcm 123 105 -18 ed_main 3111 3084 -27 func_args 73 28 -45 procps_scan 732 658 -74 top_main 2187 899 -1288 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/8 up/down: 1369/-1477) Total: -108 bytes text data bss dec hex filename 676048 2744 13968 692760 a9218 busybox_old 675940 2744 13968 692652 a91ac busybox_unstripped
* killall, pidof: use argv0 for process matching tooDenis Vlasenko2007-06-301-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | top: show cmdline, not comm field (fixes problems with re-execed applets showing as processes with name "exe", and not being found by pidof/killall by applet name) function old new delta find_pid_by_name 98 156 +58 procps_scan 692 732 +40 top_main 2724 2762 +38 find_pair 164 180 +16 collect_int 114 123 +9 cmp_main 547 555 +8 collect_fork 112 119 +7 collect_ctx 112 119 +7 read_package_field 253 257 +4 passwd_main 1983 1985 +2 process_stdin 435 433 -2 xstrtoul_range_sfx 229 226 -3 get_next_block 1852 1849 -3 arith 2042 2033 -9 sv_main 1236 1226 -10 singlemount 4690 4672 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 10/6 up/down: 189/-45) Total: 144 bytes text data bss dec hex filename 734789 3028 14400 752217 b7a59 busybox_old 734933 3028 14400 752361 b7ae9 busybox_unstripped
* procps: shrink /proc scanning code a bitDenis Vlasenko2007-06-301-16/+22
| | | | | | | | | | | | | function old new delta skip_fields 16 15 -1 .rodata 144266 144258 -8 procps_scan 739 692 -47 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-56) Total: -56 bytes text data bss dec hex filename 734845 3028 14400 752273 b7a91 busybox_old 734789 3028 14400 752217 b7a59 busybox_unstripped
* remove extra ')'Denis Vlasenko2007-06-211-1/+1
|
* top,ps: 'stringify' tty only when needed. -60 bytes.Denis Vlasenko2007-06-191-18/+6
|
* top: speedup if tty info is not requestedDenis Vlasenko2007-06-191-1/+3
|
* top,ps: reduce CPU usage in decimal conversion (optional)Denis Vlasenko2007-06-191-2/+53
| | | | | | | text data bss dec hex filename 734651 3040 14416 752107 b79eb busybox_old 734751 3040 14416 752207 b7a4f busybox_unstripped
* top: add config option and code for global CPU % displayDenis Vlasenko2007-06-101-2/+9
|
* ps: fix -Z (by Yuichi Nakamura <ynakam@hitachisoft.jp>)Denis Vlasenko2007-06-061-1/+10
|
* procps: remove all global variablesDenis Vlasenko2007-04-191-1/+1
| | | | | | | | text data bss dec hex filename 1462 14 24 1500 5dc busybox.t2/procps/ps.o 1484 0 0 1484 5cc busybox.t3/procps/ps.o 3122 0 252 3374 d2e busybox.t1/procps/top.o 3117 0 0 3117 c2d busybox.t3/procps/top.o
* ps: add -o tty and -o rss supportDenis Vlasenko2007-04-191-7/+23
| | | | | 1373 14 24 1411 583 busybox.t1/procps/ps.o 1462 14 24 1500 5dc busybox.t2/procps/ps.o
* make sure ps/top output what they claim: vsz, not rss ... down the line we ↵Mike Frysinger2007-02-081-11/+5
| | | | should make the output controllable either at runtime or buildtime as both statistics are quite useful
* ls: use get_cached_username/groupnameDenis Vlasenko2007-01-191-3/+3
|
* Trailing whitespace removal over entire treeDenis Vlasenko2007-01-111-1/+1
|
* safe_strtoXX interface proved to be a bit unconvenient.Denis Vlasenko2006-11-271-1/+2
| | | | | Remove it, introduce saner bb_strtoXX. Saved ~350 bytes.
* tar: sanitize option handlingDenis Vlasenko2006-11-241-32/+32
|
* tar: small fixes:Denis Vlasenko2006-11-241-15/+19
| | | | | * size-optimize mapping code * kill double close
* tar: cache [ug]id->username/groupname mappings. Cuts down amountDenis Vlasenko2006-11-241-18/+48
| | | | | of open/read/close of /etc/passwd and /etc/group dramatically (we were rereading those for each untarred file!!!)
* replace /proc scanning code by more versatile one.Denis Vlasenko2006-11-051-90/+171
| | | | | | | Use it where appropriate. Stop scanning /etc/passwd *for every process*!!! (uid->username) top: reduce memory usage - we won't save unneeded fields from /proc info anymore. Downside: ~+250 bytes of code
* top: improve CPU% calculationDenis Vlasenko2006-11-051-7/+0
| | | | style fixes
* Unneeded code removed, usused field "unsigned pscpu" removedDenis Vlasenko2006-11-011-4/+4
|
* PID should be stored in pid_t, not int or long.Denis Vlasenko2006-11-011-1/+2
| | | | | find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead.
* add open_read_close() and similar stuffDenis Vlasenko2006-10-141-8/+2
|
* small style fixesDenis Vlasenko2006-10-121-1/+2
|
* Remove bb_ prefixes from xfuncs.c (and a few other places), consolidateRob Landley2006-08-031-1/+1
| | | | | | | | | | things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
* decuddle () from for/if/whileMike Frysinger2006-07-121-14/+14
|
* Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top.Rob Landley2006-06-271-1/+2
|
* comment all fieldsMike Frysinger2006-06-071-4/+4
|
* add reference to proc(5)Mike Frysinger2006-06-071-0/+1
|
* - remove emacs layout block as suggested by Robert P.J. DayBernhard Reutner-Fischer2006-05-191-10/+1
| | | | - use shorter boilerplate while at it
* Portability tweak from Shaun Jackman, don't include asm/page.h directly.Rob Landley2006-04-251-1/+1
|
* - add and use bb_opendir(), bb_xopendir().Bernhard Reutner-Fischer2006-04-121-3/+1
| | | | | | | | text data bss dec hex filename 889445 9392 1035784 1934621 1d851d busybox.gcc-4.2.orig 889297 9392 1035784 1934473 1d8489 busybox.gcc-4.2 889009 9820 1037860 1936689 1d8d31 busybox.gcc-4.1.orig 888817 9820 1037860 1936497 1d8c71 busybox.gcc-4.1
* Robert P. Day removed 8 gazillion occurrences of "extern" on functionRob Landley2006-03-061-1/+1
| | | | definitions. (That should only be on prototypes.)
* cleanups after changes by Denis Vlasenko. Size optimization"Vladimir N. Oleynik"2006-02-141-6/+9
|
* Cleanups from Denis Vlasenko.Rob Landley2006-02-131-14/+23
|
* - rename libbb's password helpers as suggested in libbb.hBernhard Reutner-Fischer2005-09-201-1/+1
| | | | | | | | my_getpwnam -> bb_xgetpwnam /* dies on error */ my_getgrnam -> bb_xgetgrnam /* dies on error */ my_getgrgid -> bb_getgrgid my_getpwuid -> bb_getpwuid my_getug -> bb_getug
* ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE"Vladimir N. Oleynik"2005-09-161-3/+3
|
* FEATURE->ENABLE_FEATURE loses one for 'top' applet"Vladimir N. Oleynik"2005-09-141-3/+3
|
* A patch from Takeharu KATO to update/fix SE-Linux support.Rob Landley2005-05-031-13/+2
|
* Tito writes:Eric Andersen2004-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, I've spent the half night staring at the devilish my_getpwuid and my_getgrgid functions trying to find out a way to avoid actual and future potential buffer overflow problems without breaking existing code. Finally I've found a not intrusive way to do this that surely doesn't break existing code and fixes a couple of problems too. The attached patch: 1) changes the behaviour of my_getpwuid and my_getgrgid to avoid potetntial buffer overflows 2) fixes all occurences of this function calls in tar.c , id.c , ls.c, whoami.c, logger.c, libbb.h. 3) The behaviour of tar, ls and logger is unchanged. 4) The behavior of ps with somewhat longer usernames messing up output is fixed. 5) The only bigger change was the increasing of size of the buffers in id.c to avoid false negatives (unknown user: xxxxxx) with usernames longer than 8 chars. The value i used ( 32 chars ) was taken from the tar header ( see gname and uname). Maybe this buffers can be reduced a bit ( to 16 or whatever ), this is up to you. 6) The increase of size of the binary is not so dramatic: size busybox text data bss dec hex filename 239568 2300 36816 278684 4409c busybox size busybox_fixed text data bss dec hex filename 239616 2300 36816 278732 440cc busybox 7) The behaviour of whoami changed: actually it prints out an username cut down to the size of the buffer. This could be fixed by increasing the size of the buffer as in id.c or avoid the use of my_getpwuid and use getpwuid directly instead. Maybe this colud be also remain unchanged...... Please apply if you think it is ok to do so. The diff applies on today's cvs tarball (2004-08-25). Thanks in advance, Ciao, Tito
* Teach busybox ps to get the correct uid when displaying stuffEric Andersen2004-01-271-3/+5
|
* Patch from Atsushi Nemoto, recent MIPS kernel headersGlenn L McGrath2004-01-211-0/+4
| | | | | does not provide PAGE_SHIFT for userland (because now mips-linux kernel supports PAGESIZE other than 4K).
* bother. It seems I can't read.Eric Andersen2003-12-201-4/+0
|
* doh!Eric Andersen2003-12-201-1/+1
|
* Try to accomodate systems that do not define PAGE_SHIFTEric Andersen2003-12-201-0/+4
|
* Patch from Russell Coker:Eric Andersen2003-07-031-1/+13
| | | | | I've attached my latest SE Linux patch for busybox against the latest CVS version of busybox.
* Skip printing "/proc/%d/cmdline" stuff when it is not relevantEric Andersen2003-05-261-1/+1
|