mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #25561 from allencloud/make-more-pkgs-support-darwin
make more pkgs support darwin
This commit is contained in:
commit
3011a41d3f
10 changed files with 20 additions and 24 deletions
|
@ -13,7 +13,7 @@ func Self() string {
|
||||||
return "/proc/self/exe"
|
return "/proc/self/exe"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns *exec.Cmd which have Path as current binary. Also it setting
|
// Command returns *exec.Cmd which has Path as current binary. Also it setting
|
||||||
// SysProcAttr.Pdeathsig to SIGTERM.
|
// SysProcAttr.Pdeathsig to SIGTERM.
|
||||||
// This will use the in-memory version (/proc/self/exe) of the current binary,
|
// This will use the in-memory version (/proc/self/exe) of the current binary,
|
||||||
// it is thus safe to delete or replace the on-disk binary (os.Args[0]).
|
// it is thus safe to delete or replace the on-disk binary (os.Args[0]).
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build freebsd solaris
|
// +build freebsd solaris darwin
|
||||||
|
|
||||||
package reexec
|
package reexec
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ func Self() string {
|
||||||
return naiveSelf()
|
return naiveSelf()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns *exec.Cmd which have Path as current binary.
|
// Command returns *exec.Cmd which has Path as current binary.
|
||||||
// For example if current binary is "docker" at "/usr/bin/", then cmd.Path will
|
// For example if current binary is "docker" at "/usr/bin/", then cmd.Path will
|
||||||
// be set to "/usr/bin/docker".
|
// be set to "/usr/bin/docker".
|
||||||
func Command(args ...string) *exec.Cmd {
|
func Command(args ...string) *exec.Cmd {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !linux,!windows,!freebsd,!solaris
|
// +build !linux,!windows,!freebsd,!solaris,!darwin
|
||||||
|
|
||||||
package reexec
|
package reexec
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Command is unsupported on operating systems apart from Linux and Windows.
|
// Command is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin.
|
||||||
func Command(args ...string) *exec.Cmd {
|
func Command(args ...string) *exec.Cmd {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ func Self() string {
|
||||||
return naiveSelf()
|
return naiveSelf()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns *exec.Cmd which have Path as current binary.
|
// Command returns *exec.Cmd which has Path as current binary.
|
||||||
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
|
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
|
||||||
// be set to "C:\docker.exe".
|
// be set to "C:\docker.exe".
|
||||||
func Command(args ...string) *exec.Cmd {
|
func Command(args ...string) *exec.Cmd {
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
package sysinfo
|
|
||||||
|
|
||||||
// New returns an empty SysInfo for freebsd for now.
|
|
||||||
func New(quiet bool) *SysInfo {
|
|
||||||
sysInfo := &SysInfo{}
|
|
||||||
return sysInfo
|
|
||||||
}
|
|
9
pkg/sysinfo/sysinfo_unix.go
Normal file
9
pkg/sysinfo/sysinfo_unix.go
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// +build !linux,!solaris,!windows
|
||||||
|
|
||||||
|
package sysinfo
|
||||||
|
|
||||||
|
// New returns an empty SysInfo for non linux nor solaris for now.
|
||||||
|
func New(quiet bool) *SysInfo {
|
||||||
|
sysInfo := &SysInfo{}
|
||||||
|
return sysInfo
|
||||||
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build windows
|
||||||
|
|
||||||
package sysinfo
|
package sysinfo
|
||||||
|
|
||||||
// New returns an empty SysInfo for windows for now.
|
// New returns an empty SysInfo for windows for now.
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package system
|
|
||||||
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
// LUtimesNano is not supported by darwin platform.
|
|
||||||
func LUtimesNano(path string, ts []syscall.Timespec) error {
|
|
||||||
return ErrNotSupportedPlatform
|
|
||||||
}
|
|
|
@ -1,10 +1,10 @@
|
||||||
// +build !linux,!freebsd,!darwin
|
// +build !linux,!freebsd
|
||||||
|
|
||||||
package system
|
package system
|
||||||
|
|
||||||
import "syscall"
|
import "syscall"
|
||||||
|
|
||||||
// LUtimesNano is not supported on platforms other than linux, freebsd and darwin.
|
// LUtimesNano is only supported on linux and freebsd.
|
||||||
func LUtimesNano(path string, ts []syscall.Timespec) error {
|
func LUtimesNano(path string, ts []syscall.Timespec) error {
|
||||||
return ErrNotSupportedPlatform
|
return ErrNotSupportedPlatform
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
// Package term provides provides structures and helper functions to work with
|
// Package term provides structures and helper functions to work with
|
||||||
// terminal (state, sizes).
|
// terminal (state, sizes).
|
||||||
package term
|
package term
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue