dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.61)
+AC_PREREQ([2.68])
+AC_CONFIG_MACRO_DIR([m4])
AC_INIT([psmisc],[22.16])
AC_CONFIG_SRCDIR([src/comm.h])
AC_CONFIG_HEADER([config.h])
/*
* COMM_LEN should be the same size as TASK_COMM_LEN in the Linux source
* at include/linux/sched.h
- * However, that doesn't include the brackets that may be in the field.
*/
-#define COMM_LEN 18
+#define COMM_LEN 16
#endif
* Execute stat(2) system call with timeout to avoid deadlock
* on network based file systems.
*/
+#ifdef HAVE_TIMEOUT_STAT
+
static sigjmp_buf jenv;
-#ifdef HAVE_TIMEOUT_STAT
static void
sigalarm(int sig)
{
#define VT_HD "w"
typedef struct _proc {
- char comm[COMM_LEN + 1];
+ char comm[COMM_LEN + 2 + 1]; /* add another 2 for thread brackets */
char **argv; /* only used : argv[0] is 1st arg; undef if argc < 1 */
int argc; /* with -a : number of arguments, -1 if swapped */
pid_t pid;
perror("malloc");
exit(1);
}
- strncpy(new->comm, comm, COMM_LEN);
+ strncpy(new->comm, comm, COMM_LEN+2);
+ new->comm[COMM_LEN+2]='\0'; /* make sure nul terminated*/
new->pid = pid;
new->uid = uid;
new->flags = 0;
this = new_proc(comm, pid, uid);
#endif /*WITH_SELINUX */
else {
- strncpy(this->comm, comm, COMM_LEN);
+ strncpy(this->comm, comm, COMM_LEN+2);
this->uid = uid;
}
if (args)