From 113c5013dda3c600bda241d86c64258ec7117c7b Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Wed, 26 Jul 2023 16:19:48 +0100 Subject: [PATCH] Custom build tag "nostatfs" disables statfs (#553) This allows users to specify the "nostatfs" build tag to disable this feature if needed. In our case, we are using Tamago (https://github.com/usbarmory/tamago), which does not support syscall.Statfs. Without this change attempting to build returns 'undefined: syscall.Statfs' and 'undefined: syscall.Statfs_t'. With this change, we can build successfully build our tamago executables provided that "nostatfs" is added to the build tags. This option seems preferable to adding "tamago" as a build tag here, and will scale to other use cases too. Signed-off-by: Martin Hutchinson --- fs_statfs_notype.go | 4 ++-- fs_statfs_type.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs_statfs_notype.go b/fs_statfs_notype.go index 80057696..13d74e39 100644 --- a/fs_statfs_notype.go +++ b/fs_statfs_notype.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build netbsd || openbsd || solaris || windows -// +build netbsd openbsd solaris windows +//go:build netbsd || openbsd || solaris || windows || nostatfs +// +build netbsd openbsd solaris windows nostatfs package procfs diff --git a/fs_statfs_type.go b/fs_statfs_type.go index 6233217a..bee15144 100644 --- a/fs_statfs_type.go +++ b/fs_statfs_type.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !netbsd && !openbsd && !solaris && !windows -// +build !netbsd,!openbsd,!solaris,!windows +//go:build !netbsd && !openbsd && !solaris && !windows && !nostatfs +// +build !netbsd,!openbsd,!solaris,!windows,!nostatfs package procfs