Skip to content

Commit

Permalink
Custom build tag "nostatfs" disables statfs (#553)
Browse files Browse the repository at this point in the history
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 <mhutchinson@gmail.com>
  • Loading branch information
mhutchinson committed Jul 26, 2023
1 parent 156bf8d commit 113c501
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs_statfs_notype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions fs_statfs_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 113c501

Please sign in to comment.