mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 22:45:54 +00:00 
			
		
		
		
	'moby run' will use the kernel and initrd image produced by 'moby build' and, on macOS, will run it inside a hyperkit VM. This assumes that you have a recent version of Docker for Mac installed as it re-uses the hyperkit and VPNKit from it. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // ps provides an API for finding and listing processes in a platform-agnostic
 | |
| // way.
 | |
| //
 | |
| // NOTE: If you're reading these docs online via GoDocs or some other system,
 | |
| // you might only see the Unix docs. This project makes heavy use of
 | |
| // platform-specific implementations. We recommend reading the source if you
 | |
| // are interested.
 | |
| package ps
 | |
| 
 | |
| // Process is the generic interface that is implemented on every platform
 | |
| // and provides common operations for processes.
 | |
| type Process interface {
 | |
| 	// Pid is the process ID for this process.
 | |
| 	Pid() int
 | |
| 
 | |
| 	// PPid is the parent process ID for this process.
 | |
| 	PPid() int
 | |
| 
 | |
| 	// Executable name running this process. This is not a path to the
 | |
| 	// executable.
 | |
| 	Executable() string
 | |
| }
 | |
| 
 | |
| // Processes returns all processes.
 | |
| //
 | |
| // This of course will be a point-in-time snapshot of when this method was
 | |
| // called. Some operating systems don't provide snapshot capability of the
 | |
| // process table, in which case the process table returned might contain
 | |
| // ephemeral entities that happened to be running when this was called.
 | |
| func Processes() ([]Process, error) {
 | |
| 	return processes()
 | |
| }
 | |
| 
 | |
| // FindProcess looks up a single process by pid.
 | |
| //
 | |
| // Process will be nil and error will be nil if a matching process is
 | |
| // not found.
 | |
| func FindProcess(pid int) (Process, error) {
 | |
| 	return findProcess(pid)
 | |
| }
 |