-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Background: The 64-bit inode project was merged into the upcoming FreeBSD 12 release. It changes the ABI for structs holding inodes: stat, statfs, dirent. New system call numbers were introduced which accept the new struct layouts, the old ones were marked as COMPAT11. Their equivalent libc wrappers are using ELF symbol versioning. The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5. Backward and forward compatability is achieved by always using the new struct layouts while converting the old struct instance to the new layout on old kernels. https://svnweb.freebsd.org/base?view=revision&revision=318736 https://svnweb.freebsd.org/base?view=revision&revision=320278 The same approach is used for Go: The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs. Each type has an unexported *_freebsd11 counterpart generated the same way. Previous directly exposed syscalls like Fstat have now a wrapper in place calling either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate. If an old syscall needs to be used, then the returned *_freebsd11 result is converted to the new layout before returning from the wrapper. Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version. Drop the old struct stat8 definition in favour of the <sys/stat.h> version. Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent. Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one. Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases an *at(AT_FDCWD, ...) is used instead. Updates golang/go#22448 Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc Reviewed-on: https://go-review.googlesource.com/c/136816 Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Giovanni Bajo <[email protected]> Reviewed-by: Tobias Klauser <[email protected]>
- Loading branch information
Showing
8 changed files
with
1,086 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5535b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has
FdSet
's bit parameter been made blank here? I don't understand howSelect()
is usable if theFdSet
can't be set up. I don't see any change in FreeBSD 12 to theselect.h
ABI.This is breaking https://git.zx2c4.com/wireguard-go/tree/rwcancel/fdset_freebsd.go and I don't see a clear way forward.
5535b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktims Our GitHub code is a mirror, and very few people see comments here. I've copied your comment over to https://golang.org/cl/136816. Please take any followups there. Thanks.
5535b4e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktims https://golang.org/cl/149897 has a fix for this. The member is renamed to
Bits
such that it matches with all other systems.