daemon_windows.go 869 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package daemon
  2. import (
  3. "fmt"
  4. "os/exec"
  5. "strconv"
  6. "testing"
  7. "golang.org/x/sys/windows"
  8. "gotest.tools/v3/assert"
  9. )
  10. // SignalDaemonDump sends a signal to the daemon to write a dump file
  11. func SignalDaemonDump(pid int) {
  12. ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + strconv.Itoa(pid))
  13. h2, err := windows.OpenEvent(0x0002, false, ev)
  14. if h2 == 0 || err != nil {
  15. return
  16. }
  17. windows.PulseEvent(h2)
  18. }
  19. func signalDaemonReload(pid int) error {
  20. return fmt.Errorf("daemon reload not supported")
  21. }
  22. func cleanupMount(_ testing.TB, _ *Daemon) {}
  23. func cleanupNetworkNamespace(_ testing.TB, _ *Daemon) {}
  24. // CgroupNamespace returns the cgroup namespace the daemon is running in
  25. func (d *Daemon) CgroupNamespace(t testing.TB) string {
  26. assert.Assert(t, false)
  27. return "cgroup namespaces are not supported on Windows"
  28. }
  29. func setsid(cmd *exec.Cmd) {
  30. }