From 0ffde9fd144423ec1a9d3d31e186f5e5054b4f80 Mon Sep 17 00:00:00 2001 From: wuruilong Date: Tue, 30 Apr 2024 06:12:17 +0000 Subject: [PATCH] Add support for loong64 --- pkg/system/dup.go | 1 + pkg/system/dup_linux_loong64.go | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 pkg/system/dup_linux_loong64.go diff --git a/pkg/system/dup.go b/pkg/system/dup.go index 4fee4013..8270f057 100644 --- a/pkg/system/dup.go +++ b/pkg/system/dup.go @@ -5,6 +5,7 @@ // +build !windows // +build !linux !arm64 // +build !linux !riscv64 +// +build !linux !loong64 package system diff --git a/pkg/system/dup_linux_loong64.go b/pkg/system/dup_linux_loong64.go new file mode 100644 index 00000000..bda47e81 --- /dev/null +++ b/pkg/system/dup_linux_loong64.go @@ -0,0 +1,11 @@ +// Copyright 2019-2022 Graham Clark. All rights reserved. Use of this source +// code is governed by the MIT license that can be found in the LICENSE +// file. + +package system + +import "syscall" + +func Dup2(fd int, fd2 int) error { + return syscall.Dup3(fd, fd2, 0) +}