Skip to content

Fix build for BSD OSes family #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/util_darwin.go → cmd/util_bsd.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// This file contains Darwin (MacOS) specific calls.
// This file contains Darwin (MacOS) and *BSD specific calls.

// +build darwin
// +build freebsd openbsd dragonfly darwin

package cmd

// Unfortunatelly MacOS don't have the DUP3() system call, which is forced
// by Linux ARM64 not having the DUP2() anymore. With that, we need to
// repeat the other code and func declarations that are the same.

// FIXME: there MUST be some better way to do that... only dupFD2() should be
// here.
// FIXME: there MUST be some better way to do that... only dupFD2() should
// be here.

import "syscall"

Expand Down
7 changes: 2 additions & 5 deletions cmd/util_unix.go → cmd/util_linux.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// This file contains Linux specific calls.

// +build !windows,!darwin

package cmd

// Since we're using some system calls that are platform-specific, we need
// to make sure we have a small layer of compatibility for Unix-like and
// Windows operating systems. For now, this file is still valid for BSDs
// (MacOS NOT included)
// to make sure we have a small layer of compatibility for Linux, Windows
// and *BSD operating systems.

import "syscall"

Expand Down
2 changes: 0 additions & 2 deletions cmd/util_windows.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// This file contains Windows specific calls.

// +build windows

package cmd

// Even though Windows has a POSIX layer, it's implemented in userspace and,
Expand Down