You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a sockio_unix.go which shows support for many OSs, but it references a getSendQueueLen function.
Currently this function is only defined for Linux (in sockio_linux.go). A quick fix for FreeBSD is to:
cp sockio_linux.go sockio_bsd.go
Next patch the sockio_bsd.go with the following diff:
--- sockio_linux.go 2024-03-28 14:42:39.901422000 +0800
+++ sockio_freebsd.go 2023-04-13 11:42:33.888702000 +0800
@@ -18,14 +18,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-//go:build linux
-// +build linux
+//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd || solaris
+// +build aix || darwin || dragonfly || freebsd || netbsd || openbsd || solaris
package tchannel
import "golang.org/x/sys/unix"
func getSendQueueLen(fd uintptr) (int, error) {
- // https://linux.die.net/man/7/tcp
- return unix.IoctlGetInt(int(fd), unix.SIOCOUTQ)
+ return unix.IoctlGetInt(int(fd), unix.TIOCOUTQ)
}
Better Alternative (perhaps)
Alternatively the function using unix.TIOCOUTQ could just be added to sockio_unix.go and the sockio_linux.go removed. From inspection of the files in go120/src/cmd/vendor/golang.org/x/sys/unix/ - All the OSs supported by sockio_unix.go have the TIOCOUTQ IOCTL and in the various Linux files this has exactly the same as the SIOCOUTQ value.
The text was updated successfully, but these errors were encountered:
moonetic
added a commit
to moonetic/tchannel-go
that referenced
this issue
Oct 31, 2024
This PR fixes compilation fail on FreeBSD 14, described on [issue by hxw](uber#914)
The problem is, that there's no getSendQueueLen function defined for bsd platform, which causes compile failure. The fix adds new, sockio_bsd file with corresponding function implementation and build tags.
This PR fixes compilation fail on FreeBSD 14, described on [issue by hxw](uber#914)
The problem is, that there's no getSendQueueLen function defined for bsd platform, which causes compile failure. The fix adds new, sockio_bsd file with corresponding function implementation and build tags.
Quick Fix
There is a
sockio_unix.go
which shows support for many OSs, but it references a getSendQueueLen function.Currently this function is only defined for Linux (in sockio_linux.go). A quick fix for FreeBSD is to:
Next patch the sockio_bsd.go with the following diff:
Better Alternative (perhaps)
Alternatively the function using
unix.TIOCOUTQ
could just be added tosockio_unix.go
and thesockio_linux.go
removed. From inspection of the files ingo120/src/cmd/vendor/golang.org/x/sys/unix/
- All the OSs supported bysockio_unix.go
have theTIOCOUTQ
IOCTL and in the various Linux files this has exactly the same as theSIOCOUTQ
value.The text was updated successfully, but these errors were encountered: