From 9b5e9ee31fcc6530ff188b60a9d11933e61716f7 Mon Sep 17 00:00:00 2001 From: Dandan Zhang Date: Mon, 30 Oct 2023 11:39:24 +0000 Subject: [PATCH] Build on loong64 --- core/open_out_log_linux_loong64.go | 23 +++++++++++++++++++++++ core/open_out_log_unix.go | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 core/open_out_log_linux_loong64.go diff --git a/core/open_out_log_linux_loong64.go b/core/open_out_log_linux_loong64.go new file mode 100644 index 00000000..7fb618a6 --- /dev/null +++ b/core/open_out_log_linux_loong64.go @@ -0,0 +1,23 @@ +//go:build linux && loong64 +// +build linux,loong64 + +// Copyright 2017 LinkedIn Corp. Licensed under the Apache License, Version +// 2.0 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +package core + +import ( + "syscall" +) + +// linux_loong64 doesn't have syscall.Dup2, so use +// the nearly identical syscall.Dup3 instead +func internalDup2(oldfd uintptr, newfd uintptr) error { + return syscall.Dup3(int(oldfd), int(newfd), 0) +} diff --git a/core/open_out_log_unix.go b/core/open_out_log_unix.go index d1c04187..68d632f5 100644 --- a/core/open_out_log_unix.go +++ b/core/open_out_log_unix.go @@ -1,6 +1,7 @@ -//go:build !windows && !(linux && arm64) +//go:build !windows && !(linux && arm64) && !(linux && loong64) // +build !windows // +build !linux !arm64 +// +build !linux !loong64 // Copyright 2017 LinkedIn Corp. Licensed under the Apache License, Version // 2.0 (the "License"); you may not use this file except in compliance with