Further fixes for FreeBSD
This fixes a lot more issues for FreeBSD, including update for continuity vendor. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
15
vendor/github.com/containerd/continuity/devices_freebsd.go
generated
vendored
Normal file
15
vendor/github.com/containerd/continuity/devices_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package continuity
|
||||
|
||||
// from /usr/include/sys/types.h
|
||||
|
||||
func getmajor(dev uint32) uint64 {
|
||||
return (uint64(dev) >> 24) & 0xff
|
||||
}
|
||||
|
||||
func getminor(dev uint32) uint64 {
|
||||
return uint64(dev) & 0xffffff
|
||||
}
|
||||
|
||||
func makedev(major int, minor int) int {
|
||||
return ((major << 24) | minor)
|
||||
}
|
||||
2
vendor/github.com/containerd/continuity/devices_unix.go
generated
vendored
2
vendor/github.com/containerd/continuity/devices_unix.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// +build linux darwin
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package continuity
|
||||
|
||||
|
||||
2
vendor/github.com/containerd/continuity/driver_unix.go
generated
vendored
2
vendor/github.com/containerd/continuity/driver_unix.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// +build linux darwin
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package continuity
|
||||
|
||||
|
||||
4
vendor/github.com/containerd/continuity/hardlinks_unix.go
generated
vendored
4
vendor/github.com/containerd/continuity/hardlinks_unix.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// +build linux darwin
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package continuity
|
||||
|
||||
@@ -32,5 +32,5 @@ func newHardlinkKey(fi os.FileInfo) (hardlinkKey, error) {
|
||||
return hardlinkKey{}, errNotAHardLink
|
||||
}
|
||||
|
||||
return hardlinkKey{dev: uint64(sys.Dev), inode: sys.Ino}, nil
|
||||
return hardlinkKey{dev: uint64(sys.Dev), inode: uint64(sys.Ino)}, nil
|
||||
}
|
||||
|
||||
2
vendor/github.com/containerd/continuity/manifest.go
generated
vendored
2
vendor/github.com/containerd/continuity/manifest.go
generated
vendored
@@ -7,8 +7,8 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
pb "github.com/containerd/continuity/proto"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
// Manifest provides the contents of a manifest. Users of this struct should
|
||||
|
||||
2
vendor/github.com/containerd/continuity/resource.go
generated
vendored
2
vendor/github.com/containerd/continuity/resource.go
generated
vendored
@@ -7,8 +7,8 @@ import (
|
||||
"reflect"
|
||||
"sort"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
pb "github.com/containerd/continuity/proto"
|
||||
"github.com/opencontainers/go-digest"
|
||||
)
|
||||
|
||||
// TODO(stevvooe): A record based model, somewhat sketched out at the bottom
|
||||
|
||||
2
vendor/github.com/containerd/continuity/resource_unix.go
generated
vendored
2
vendor/github.com/containerd/continuity/resource_unix.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// +build linux darwin
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package continuity
|
||||
|
||||
|
||||
17
vendor/github.com/containerd/continuity/sysx/chmod_freebsd.go
generated
vendored
Normal file
17
vendor/github.com/containerd/continuity/sysx/chmod_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package sysx
|
||||
|
||||
const (
|
||||
// AtSymlinkNoFollow defined from AT_SYMLINK_NOFOLLOW in <sys/fcntl.h>
|
||||
AtSymlinkNofollow = 0x200
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
// SYS_FCHMODAT defined from golang.org/sys/unix
|
||||
SYS_FCHMODAT = 490
|
||||
)
|
||||
|
||||
// These functions will be generated by generate.sh
|
||||
// $ GOOS=freebsd GOARCH=amd64 ./generate.sh chmod
|
||||
|
||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
25
vendor/github.com/containerd/continuity/sysx/chmod_freebsd_amd64.go
generated
vendored
Normal file
25
vendor/github.com/containerd/continuity/sysx/chmod_freebsd_amd64.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// mksyscall.pl chmod_freebsd.go
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = syscall.BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := syscall.Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
use(unsafe.Pointer(_p0))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
7
vendor/github.com/containerd/continuity/sysx/nodata_linux.go
generated
vendored
Normal file
7
vendor/github.com/containerd/continuity/sysx/nodata_linux.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const ENODATA = syscall.ENODATA
|
||||
9
vendor/github.com/containerd/continuity/sysx/nodata_unix.go
generated
vendored
Normal file
9
vendor/github.com/containerd/continuity/sysx/nodata_unix.go
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// +build darwin freebsd
|
||||
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const ENODATA = syscall.ENOATTR
|
||||
53
vendor/github.com/containerd/continuity/sysx/xattr_freebsd.go
generated
vendored
Normal file
53
vendor/github.com/containerd/continuity/sysx/xattr_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Initial stub version for FreeBSD. FreeBSD has a different
|
||||
// syscall API from Darwin and Linux for extended attributes;
|
||||
// it is also not widely used. It is not exposed at all by the
|
||||
// Go syscall package, so we need to implement directly eventually.
|
||||
|
||||
var unsupported error = errors.New("extended attributes unsupported on FreeBSD")
|
||||
|
||||
// Listxattr calls syscall listxattr and reads all content
|
||||
// and returns a string array
|
||||
func Listxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// Removexattr calls syscall removexattr
|
||||
func Removexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Setxattr calls syscall setxattr
|
||||
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Getxattr calls syscall getxattr
|
||||
func Getxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, nil
|
||||
}
|
||||
|
||||
// LListxattr lists xattrs, not following symlinks
|
||||
func LListxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// LRemovexattr removes an xattr, not following symlinks
|
||||
func LRemovexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LSetxattr sets an xattr, not following symlinks
|
||||
func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LGetxattr gets an xattr, not following symlinks
|
||||
func LGetxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user