Mirror of git://git.busybox.net/busybox with our patches on top
Source
/* vi: set sw=4 ts=4: */
/*
* pidof implementation for busybox
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* Licensed under the GPL v2, see the file LICENSE in this tarball.
*/
extern int pidof_main(int argc, char **argv)
{
unsigned n = 0;
unsigned fail = 1;
unsigned long int opt;
llist_t *omits = NULL; /* list of pids to omit */
bb_opt_complementally = _OMIT_COMPL("o::");
/* do unconditional option parsing */
opt = bb_getopt_ulflags(argc, argv,
_SINGLE_COMPL("s") _OMIT_COMPL("o:")
_OMIT(&omits));
/* fill omit list. */
{
char getppid_str[32];