aboutsummaryrefslogtreecommitdiff
path: root/libbb/find_pid_by_name.c
AgeCommit message (Collapse)Author
2009-07-29make find_pid_by_name look at /proc/PID/exe tooAlexander Shishkin
function old new delta procps_scan 1642 1709 +67 find_pid_by_name 193 223 +30 free_procps_scan 29 37 +8 Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-02-14killall and sestatus also need ARGVN scanningDenis Vlasenko
2008-09-05- commentary typo fixBernhard Reutner-Fischer
2008-07-17pidof/killall: allow find_pid_by_name to find runningDenis Vlasenko
processes started as scripts_with_name_longer_than_15_bytes.sh closes bug 4054 (and is generally neat)
2008-06-27*: introduce and use FAST_FUNC: regparm on i386, otherwise no-onDenis Vlasenko
text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
2007-11-25which: fix testsuite failureDenis Vlasenko
pidof: do not output empty line if nothing found testsuite: disable false positive
2007-06-30introduce and use bb_basename()Denis Vlasenko
function old new delta bb_basename - 26 +26 sv_main 1226 1225 -1 passwd_main 1985 1983 -2 showdirs 482 478 -4 sendCgi 1811 1807 -4 make_device 1354 1350 -4 handleIncoming 2443 2439 -4 func_name 82 78 -4 service_name 2292 2285 -7 main 909 901 -8 cmp_main 555 547 -8 test_main 434 422 -12 act 228 216 -12 find_pair 180 164 -16 rmmod_main 298 280 -18 find_pid_by_name 156 134 -22 modprobe_main 1606 1576 -30 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/16 up/down: 26/-156) Total: -130 bytes text data bss dec hex filename 734933 3028 14400 752361 b7ae9 busybox_old 734801 3028 14400 752229 b7a65 busybox_unstripped
2007-06-30killall, pidof: use argv0 for process matching tooDenis Vlasenko
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
2007-06-23pidof: size optimizations (-50 bytes)Denis Vlasenko
2006-11-05replace /proc scanning code by more versatile one.Denis Vlasenko
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
2006-11-01PID should be stored in pid_t, not int or long.Denis Vlasenko
find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead.
2006-09-27process utilities related style cleanupDenis Vlasenko
2006-09-13- fix copy'n paste errors that got introduced when switching to the shorter ↵Bernhard Reutner-Fischer
boilerplate. No object code changes.
2006-05-19- remove emacs layout block as suggested by Robert P.J. DayBernhard Reutner-Fischer
- use shorter boilerplate while at it
2006-03-06Robert P. Day removed 8 gazillion occurrences of "extern" on functionRob Landley
definitions. (That should only be on prototypes.)
2005-10-07- size reduction of pidofBernhard Reutner-Fischer
- fix typo in reverse_pidlist
2005-10-06- add llist_free_one() and llist_free() to libbb; Add a bit of documentation.Bernhard Reutner-Fischer
- change llist_add_to_end as proposed by vodz in http://busybox.net/lists/busybox/2005-September/016411.html - remove unneeded includes, add short boilerplate and copyright to llist.c - move COMM_LEN from find_pid_by_name to libbb.h and use it in procps_status_t - add reverse_pidlist() to find_pid_by_name. Will be needed for pidof.
2005-05-03A patch from Takeharu KATO to update/fix SE-Linux support.Rob Landley
2004-03-15Remove trailing whitespace. Update copyright to include 2004.Eric Andersen
2003-08-06Joe.C writes:Eric Andersen
I've reported this bug in April and it still exists in 1.00-pre2. So I made patches for both 0.60.x and 1.00-pre2. The patch is very simple, just use strncmp instead of strcmp. Please apply if it is OK. Here's the procedure to test this problem: Create a executable with very long name, say 'test_1234567890123456' and execute it. Try using 'killall' or 'pidof' to find/kill this program. Without this patch, you can't find the program.
2003-07-14Update a bunch of docs. Run a script to update my email addr.Eric Andersen
2003-07-03Patch from Russell Coker:Eric Andersen
I've attached my latest SE Linux patch for busybox against the latest CVS version of busybox.
2003-05-26Remove cruftEric Andersen
2002-12-05Kill CONFIG_FEATURE_USE_DEVPS_PATCH and the devps patch. I'm notEric Andersen
maintaining it anymore, and it is now terribly out of date. -Erik
2002-10-22Patch last_pach62 from vodz. This patch moves all the /proc parsingEric Andersen
code into libbb so it can be shared by ps, top, etc, saving over 1.5k.
2001-12-06If find_pid_by_name() had an error, it was returning -1, but storingEric Andersen
that into a pid_t, which is unsigned on a number archs. Furthermore, find_pid_by_name() would _never_ return an error if the intended proces was "init", but instead would return 1, meaning we would fail to work on 2.4.x kernels running an initrd... -Erik
2001-10-24Major rework of the directory structure and the entire build system.Eric Andersen
-Erik
2001-07-05Fix a stupid thinko, and fix killall to cope with the updatedEric Andersen
find_pid_by_name() interface -Erik
2001-07-05Implement suggestion from Adam Slattery, (don't default to killing closing ↵Eric Andersen
bug #1190.
2001-06-26Make it so we don't segfault when /proc isn't mounted -- guess pid 1...Eric Andersen
-Erik
2001-03-17Patch from Pierre PEIFFER <pierre.peiffer@sxb.bsf.alcatel.fr>Eric Andersen
that copes with the fact that processes may have been swapped out.
2001-03-16Convert utility.c into libbb.a. It is now a whole pile of .cEric Andersen
files. Clean up the resulting damage and fix up the makefile. -Erik