ps: Match on truncated 16 char for -C
The referenced commit the comm length was increased from 16 to 64
characters to handle the larger command names for things like kernel
threads.
However most user processes are limited to 15 characters which means
if you try something like ps -C myprogramisbiggerthansixteen this would
fail to match because /proc/<PID>/comm would only be myprogramisbigg
ps now checks the comm length and if it is 15 and if the given match
is 15 or more, it will only match the first 15 characters.
This is also how killall has worked for about a year.
Thanks to Jean Delvare <jdelvare@suse.de> for the note.
References:
 commit 14005a371e
 commit psmisc/psmisc@1188315cd0
Signed-off-by: Craig Small <csmall@dropbear.xyz>
			
			
This commit is contained in:
		
							
								
								
									
										1
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS
									
									
									
									
									
								
							@@ -7,6 +7,7 @@ procps-ng NEXT
 | 
			
		||||
  * pgrep: Add older than selection                        merge #79
 | 
			
		||||
  * pidof: show worker threads                             Redhat #1803640
 | 
			
		||||
  * ps.1: Mention stime alias                              issue #164
 | 
			
		||||
  * ps: check also match on truncated 16 char comm names
 | 
			
		||||
  * sysctl: Match systemd directory order
 | 
			
		||||
  * sysctl: Document directory order                       Debian #951550
 | 
			
		||||
  * top: ensure config file backward compatibility         Debian #951335
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user