mirror of
				https://github.com/containers/podman.git
				synced 2025-11-01 02:42:11 +08:00 
			
		
		
		
	vendor latest containers/psgo
Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1162 Approved by: rhatdan
This commit is contained in:
		 Valentin Rothberg
					Valentin Rothberg
				
			
				
					committed by
					
						 Atomic Bot
						Atomic Bot
					
				
			
			
				
	
			
			
			 Atomic Bot
						Atomic Bot
					
				
			
						parent
						
							d9ae17400d
						
					
				
				
					commit
					159f7f179b
				
			
							
								
								
									
										22
									
								
								vendor/github.com/containers/psgo/internal/proc/cmdline.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								vendor/github.com/containers/psgo/internal/proc/cmdline.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| package proc | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"fmt" | ||||
| 	"io/ioutil" | ||||
| ) | ||||
|  | ||||
| // ParseCmdLine parses a /proc/$pid/cmdline file and returns a string slice. | ||||
| func ParseCmdLine(pid string) ([]string, error) { | ||||
| 	data, err := ioutil.ReadFile(fmt.Sprintf("/proc/%s/cmdline", pid)) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	cmdLine := []string{} | ||||
| 	for _, rawCmd := range bytes.Split(data, []byte{0}) { | ||||
| 		cmdLine = append(cmdLine, string(rawCmd)) | ||||
| 	} | ||||
|  | ||||
| 	return cmdLine, nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user