aboutsummaryrefslogtreecommitdiff
path: root/utils/ps.c
Commit message (Collapse)AuthorAgeFilesLines
* Modernize code by removing use of old style definitions.Flavio Cruz2023-04-031-1/+1
| | | | | Also add -Werror=old-style-definition to enforce new code. Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
* Fix build warningsSamuel Thibault2022-01-011-0/+1
| | | | No actual behavior change.
* utils/ps.c: Don't limit output width to 80 on non-ttySergey Bugaev2021-05-181-0/+5
| | | | | | | | If no output width limit has been set explicitly, and we're not printing to a tty, do not limit output width. In particular, this fixes grepping ps output. Message-Id: <20210518122150.1490468-1-bugaevc@gmail.com>
* libps: support getting RPC names for WAIT outputSamuel Thibault2020-11-231-0/+2
| | | | | | | | | | | * libps/Makefile (SRCS): Add ../utils/msgids.c. (../utils/msgids-CPPFLAGS): Add DATADIR macro. * libps/spec.c: Include "../utils/msgids.h". (get_rpc_name): Implement with msgid_info. * utils/msgids.c (parse_opt): Move end code to ... (msgids_scan_std): ... new function. * utils/msgids.h (msgids_scan_std): New prototype. * utils/ps.c (main): Call msgids_scan_std.
* Use our own variant of 'assert' and 'assert_perror'.Justus Winter2017-08-051-1/+1
| | | | | Our variants print stack traces on failures. This will make locating errors much easier.
* Do not expand format name in posix format optionCyril Roelandt2012-12-171-0/+2
| | | | | | | | | This fixes hang of ps -o user * utils/ps.c (parse_opt): When POSIX_FMT is set, do not lookup format name from OUTPUT_FMTS.
* Fix ps segfault when given empty format stringSamuel Thibault2010-02-071-18/+22
| | | | | | | 2010-02-02 Carl Fredrik Hammar <hammy.lite@gmail.com> * utils/ps.c (main): Move format parsing to parse_opt() and pass state to parse_enum().
* 2006-03-15 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2006-03-141-2/+2
| | | | | | * ps.c (current_tty_name): Don't declare as static. * rpctrace.c (print_contents): Don't use ?: as a lvalue. (msgids_file_p): Don't declare as static.
* 2002-05-28 Roland McGrath <roland@frob.com>Roland McGrath2002-05-281-2/+2
| | | | | | | | | | | | | | | | * pids.c (add_fn_pids): unsigned -> size_t * w.c (add_utmp_procs): Likewise. * login.c (add_canonical_host): Likewise. * ps.c (main): Likewise. * login.c (add_entry, main): Likewise. * settrans.c (main): int -> size_t * showtrans.c (main): Likewise. * fsysopts.c (main): Likewise. * vmstat.c (main): Use int for FWIDTHS. * ping.c (main): size_t -> socklen_t * fakeauth.c (S_auth_getids, S_auth_makeauth, S_auth_server_authenticate): u_int -> size_t * showtrans.c (main): Cast field width/precision args to int.
* 1999-06-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-06-201-3/+3
| | | | * ps.c (options): Doc fix.
* 1999-05-29 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-05-291-2/+2
| | | | | * ps.c (output_fmts): Add %start and %time specs before %command in "user" (ps -u) format.
* 1998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1998-07-201-6/+6
| | | | | | | | | | | * ps.c (main): Fix return type to int, and use return. * ids.c (main): Likewise. * w.c (main): Likewise. * login.c (main): Likewise. * settrans.c (main): Likewise. * showtrans.c (main): Likewise. * fsysopts.c (main): Likewise. * storeinfo.c (main): Likewise.
* (main):Miles Bader1997-05-271-13/+12
| | | | | | | Correct filtering of process-owners when processes are explicitly specified. Don't use ARGS_DOC. (args_doc): Variable removed.
* (current_lid, current_sid):Miles Bader1997-05-261-137/+75
| | | | | | | | | | | | | | Functions removed. (main): Use PIDS_ARGP to select processes. Use new forms of parse_ functions. (lookup_user): Take new STATE argument. (options): Rearranged to group similar options. Process-selection options removed. "pids.h": New include.
* (procset_names, fmt_sortkeys, fmt_names, fmts): Variables removed.Miles Bader1997-05-151-59/+38
| | | | | | | | (enum procsets): Type removed. (struct output_fmt): New type. (output_fmt): New variable. (parse_enum): Function removed. (main): Use new version of parse_enum & output_fmts variable.
* (_parse_strlist, parse_strlist, parse_numlist):Miles Bader1997-05-151-99/+1
| | | | | Functions removed. Include "parse.h".
* (argp_program_version): Make const.Miles Bader1997-02-201-2/+2
|
* (main):Miles Bader1996-12-171-1/+8
| | | | | | | Implement --bottom/--tail/-b. (options): Update doc for --top. Add --head and --bottom/--tail/-b options.
* (options, main):Miles Bader1996-10-171-1/+4
| | | | Add --top/-h option.
* *** empty log message ***Thomas Bushnell1996-09-051-1/+3
|
* (doc): Add program description.Miles Bader1996-08-271-4/+4
|
* (options): Whoops, short option for --sort is -s.Miles Bader1996-08-101-1/+1
|
* (options, main):Miles Bader1996-08-011-20/+13
| | | | | | | | | | | Change --fmt to --format/-F. Change --posix-fmt/-o to --posix-format/-o. Change --sort to --sort/-s. Change --pgrp to --pgrp/-G. Change --login to --login/-L. Change --threads/-s to --threads/-T. Change --session to --session/-S. (OPT_FMT, OPT_SORT, OPT_PGRP, OPT_LOGIN, OPT_SESS): Macros removed.
* (argp_program_version): New variable.Miles Bader1996-07-061-0/+2
|
* (main): Fix heuristic to decide whether native booted.Miles Bader1996-06-241-3/+11
|
* (spec_abbrevs): Still use `NTH' for field name, just `TH' for title.Miles Bader1996-05-281-2/+2
| | | | (fmts): Use %nth.
* (fmts): Use %sz for vmem format, not %size.Miles Bader1996-05-281-1/+1
|
* (parse_opt): Use ARGP_ERR_UNKNOWN instead of EINVAL.Miles Bader1996-05-111-14/+14
| | | | | (_parse_strlist, parse_strlist, parse_numlist, lookup_user, main): Slather on consts, in a misguided attempt to shut up the compier.
* (parse_strlist): Make DEFAULT_FN return a const char *.Miles Bader1996-05-101-1/+1
|
* (main) [current_tty_name]: Remove `const' keyword to avoid type clash.Michael I. Bushnell1996-05-091-1/+1
|
* (main) [proc_stat_has_ctty]: Add parentheses around assignment used asMichael I. Bushnell1996-05-091-1/+1
| | | | truth value.
* (fmts): Use new field syntax.Miles Bader1996-05-071-33/+21
| | | | | (options, main): Add -o/--posix-fmt option. -A is an alias. "psout.h": New include.
* (main): Try to intuit whether this is a native-booted hurd system, and if so,Miles Bader1996-04-231-2/+12
| | | | don't filtered out non-parented processes.
* (spec_abbrevs): Make const.Miles Bader1996-03-291-24/+24
| | | | | (ps_specs): Make non-const. (...various...): Use real types instead of old ps typedefs.
* (main): Pass new arg to argp_parse.Miles Bader1996-03-191-1/+1
|
* Include <error.h> instead of "error.h".Miles Bader1996-03-051-3/+1
| | | | "common.h": Don't include this anymore.
* (main): Don't make -a imply -g.Miles Bader1996-02-151-1/+1
|
* (main): Get rid of totally dead processes/threads.Miles Bader1996-02-151-21/+45
| | | | | | | | (add_pid): Complain about non-existant processes. (parse_opt): Don't turn quoted args into options. (parse_numlist): Correctly handle NULL hook functions. (main): Update calls to changed proc_stat_list_add_* functions. (psout): New declaration.
* (main): Move a bunch of stuff into psout() in psout.c.Miles Bader1996-01-231-133/+27
| | | | | | | (spec_abbrevs, ps_specs): New variables. (fmts): Get rid of redundant header specifications. (fmt_sortrevs): Variable removed. (main, options): Rename -o flag to -U for posix compat (ick).
* (main, options): If the specified sort field begins with `-', reverse the sort.Miles Bader1995-12-211-121/+75
| | | | | | | | | | (main): If there is no current uid, don't try to filter with it. (FILTER_NOT_LEADER): Renamed from FILTER_NSESSLDR. (main): Rename ps_not_leader_filter from ps_not_sess_leader_filter. (main): Use idvec routines instead of ids. Use argz functions to store tty_names instead of our own. (make_ids, ids_add, ids_contains): Routines deleted. Include <idvec.h>.
* (options): Reformat doc string for --tty option.Miles Bader1995-12-171-2/+2
|
* (main): Implement 'w' option.Miles Bader1995-12-171-2/+28
| | | | (options): Add argument and doc for 'w' option.
* (main):Miles Bader1995-12-061-3/+3
| | | | Change uses of the INDEX field in argp_state structures to use NEXT instead.
* (main): Use new libps stream type.Miles Bader1995-11-211-4/+9
|
* (main): Grow TTY_NAMES properly even when it's empty.Miles Bader1995-11-141-1/+1
|
* (ids_add): Increase the size of IDS even when 0.Miles Bader1995-11-081-1/+1
|
* (options): Add --not-owner/-O option.Miles Bader1995-11-021-27/+75
| | | | | | | | | | (id_t, struct ids): New type. (make_ids, ids_add, ids_contains): New functions. (main): Use a struct ids instead of multiple variables to hold the wanted uids list, which renamed to ONLY_UIDS. Add the NOT_UIDS list to contain the opposite sense, and use it. (main): Use proc_stat_proc_info instead of proc_stat_info and PSTAT_PROC_INFO instead of PSTAT_INFO.
* (fmts): Add RPC field to the -l format.Miles Bader1995-11-021-1/+1
|
* (options): --all is -e, not -a.Miles Bader1995-10-301-1/+1
|
* (parse_enum): Use argp_error.Miles Bader1995-10-211-9/+2
|