bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pgrep and pkill (any? arguments): cannot allocate 4294967295 bytes


From: Paul Dufresne
Subject: Re: pgrep and pkill (any? arguments): cannot allocate 4294967295 bytes
Date: Tue, 02 Feb 2021 12:10:06 -0500
User-agent: Zoho Mail

Grrhh! Sorry! Had diff arguments in reverse orders.

root@kibar:~/procps-3.3.16# diff -u ../orig/procps-3.3.16/pgrep.c pgrep.c
--- ../orig/procps-3.3.16/pgrep.c       2020-02-06 06:04:02.000000000 -0500
+++ pgrep.c     2021-02-02 11:39:44.000000000 -0500
@@ -498,6 +498,8 @@
        pid_t myself = getpid();
        struct el *list = NULL;
         long cmdlen = sysconf(_SC_ARG_MAX) * sizeof(char);
+       if (cmdlen==-1) // sysconf returned "no limitations"
+               cmdlen=1000; // 1000 chars (arbitrary value)
        char *cmdline = xmalloc(cmdlen);
        char *cmdsearch = xmalloc(cmdlen);
        char *cmdoutput = xmalloc(cmdlen);
root@kibar:~/procps-3.3.16#








reply via email to

[Prev in Thread] Current Thread [Next in Thread]