]> granicus.if.org Git - sysstat/commitdiff
Use system constants for process name length and username length.
authorMike Winter <mike.winter@usask.ca>
Tue, 18 Oct 2016 17:24:45 +0000 (11:24 -0600)
committerMike Winter <mike.winter@usask.ca>
Tue, 18 Oct 2016 17:24:45 +0000 (11:24 -0600)
pidstat.h

index b93599f2c0f034adbb3bdc025e2afb1b1c97c6d9..c8ea0576f3851af5816e5d20b3ad767986535c50 100644 (file)
--- a/pidstat.h
+++ b/pidstat.h
@@ -3,6 +3,9 @@
  * (C) 2007-2016 by Sebastien Godard (sysstat <at> orange.fr)
  */
 
+#include <sys/param.h>
+#undef HZ
+
 #ifndef _PIDSTAT_H
 #define _PIDSTAT_H
 
@@ -15,9 +18,9 @@
 
 #define NR_PID_PREALLOC        100
 
-#define MAX_COMM_LEN   128
-#define MAX_CMDLINE_LEN        128
-#define MAX_USER_LEN   32
+#define MAX_COMM_LEN    _POSIX_ARG_MAX
+#define MAX_CMDLINE_LEN _POSIX_ARG_MAX
+#define MAX_USER_LEN    LOGIN_NAME_MAX
 
 /* Activities */
 #define P_A_CPU                0x01