kill -l List all signal names.
kill -L List all signal names in a nice table.
kill -l signal Convert a signal number into a name.
+kill -V,--version Show version of program
.TE
.SH DESCRIPTION
#include "proc/sig.h"
#include "proc/devname.h"
#include "proc/sysinfo.h"
+#include "proc/version.h" /* procps_version */
static int i_am_pkill = 0;
char *progname = "pgrep";
static int conv_str (const char *, union el *);
static int match_numlist (long, const union el *);
static int match_strlist (const char *, const union el *);
+static void display_pgrep_version(void);
static int
strcat (opts, "ld:");
}
- strcat (opts, "fnvxP:g:s:u:U:G:t:?");
+ strcat (opts, "fnvxP:g:s:u:U:G:t:?V");
while ((opt = getopt (argc, argv, opts)) != -1) {
switch (opt) {
case '?':
usage (opt);
break;
+ case 'V':
+ display_pgrep_version();
+ exit(0);
}
}
if (argc - optind == 1)
}
return ((procs[0].num) == 0 ? 1 : 0);
}
+
+static void display_pgrep_version(){
+ fprintf(stdout, "%s (%s)\n", progname, procps_version);
+}
T}
-w warnings enabled This is not currently useful.
-n no action This only displays the process ID.
+-V show version Displays version of program.
.TE
.SH "PROCESS SELECTION OPTIONS"
#include <proc/sig.h>
#include <proc/devname.h>
#include <proc/procps.h> /* char *user_from_uid(uid_t uid) */
+#include "proc/version.h" /* procps_version */
static int f_flag, i_flag, v_flag, w_flag, n_flag;
/********************************************************************/
+static void display_kill_version(){
+
+ switch(program) {
+ case PROG_KILL:
+ fprintf(stdout, "kill (%s)\n",procps_version);
+ return;
+ case PROG_SKILL:
+ fprintf(stdout, "skill (%s)\n",procps_version);
+ return;
+ case PROG_SNICE:
+ fprintf(stdout, "snice (%s)\n",procps_version);
+ return;
+ default:
+ fprintf(stdout, "unknown (%s)\n",procps_version);
+ return;
+ }
+}
/***** kill or nice a process */
static void hurt_proc(int tty, int uid, int pid, char *cmd){
int signo = SIGTERM;
int exitvalue = 0;
if(argc<2) kill_usage();
+ if(!strcmp(argv[1],"-V")|| !strcmp(argv[1],"--version")){
+ display_kill_version();
+ exit(0);
+ }
if(argv[1][0]!='-'){
argv++;
argc--;
unix_print_signals();
exit(0);
}
+ if(!strcmp(argv[1],"-V")|| !strcmp(argv[1],"--version")){
+ display_kill_version();
+ exit(0);
+ }
skillsnice_usage();
}
NEXTARG;