Skip to content

Commit

Permalink
Merge pull request moby#42866 from akhramov/feature/pkg-system-port-t…
Browse files Browse the repository at this point in the history
…o-FreeBSD

Port pkg/system/mknod.go to FreeBSD
  • Loading branch information
AkihiroSuda authored Sep 23, 2021
2 parents 6014c1e + f3d3994 commit 8dd2a3c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/system/mknod.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ import (
"golang.org/x/sys/unix"
)

// Mknod creates a filesystem node (file, device special file or named pipe) named path
// with attributes specified by mode and dev.
func Mknod(path string, mode uint32, dev int) error {
return unix.Mknod(path, mode, dev)
}

// Mkdev is used to build the value of linux devices (in /dev/) which specifies major
// and minor number of the newly created device special file.
// Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes.
Expand Down
14 changes: 14 additions & 0 deletions pkg/system/mknod_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build freebsd
// +build freebsd

package system // import "github.com/docker/docker/pkg/system"

import (
"golang.org/x/sys/unix"
)

// Mknod creates a filesystem node (file, device special file or named pipe) named path
// with attributes specified by mode and dev.
func Mknod(path string, mode uint32, dev int) error {
return unix.Mknod(path, mode, uint64(dev))
}
11 changes: 11 additions & 0 deletions pkg/system/mknod_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package system // import "github.com/docker/docker/pkg/system"

import (
"golang.org/x/sys/unix"
)

// Mknod creates a filesystem node (file, device special file or named pipe) named path
// with attributes specified by mode and dev.
func Mknod(path string, mode uint32, dev int) error {
return unix.Mknod(path, mode, dev)
}

0 comments on commit 8dd2a3c

Please sign in to comment.