Skip to content

pgrep: Use POSIX _SC_ARG_MAX for maximum pgrep -f command line length

Clay B. requested to merge cbaenziger/procps:pgrep_more_than_4k into master

This may be an alternative to !80 (closed) for addressing #86 (closed). This bit me in some code I worked on in https://github.com/bloomberg/locking_resource-cookbook/issues/6. (Similarly as mentioned in #86 (closed) due to Java commands with a very long classpath in the command string.)

A quick test for this fix is to vi a file using a filename over 4k (e.g. vi $(seq 1 1250| paste -s -d'_')_foo.txt) and leave vi running; then try running the new pgrep -af 'foo.txt' to find it.

Edited by Clay B.

Merge request reports