diff --git a/go.mod b/go.mod
index 176b1d0..64ae1b6 100644
--- a/go.mod
+++ b/go.mod
@@ -7,6 +7,7 @@ require (
 	github.com/antchfx/xmlquery v1.3.3
 	github.com/antchfx/xpath v1.1.11 // indirect
 	github.com/blang/semver v3.5.1+incompatible
+	github.com/creack/pty v1.1.21 // indirect
 	github.com/flytam/filenamify v1.1.0
 	github.com/gcla/deep v1.0.2
 	github.com/gcla/gowid v1.4.0
diff --git a/go.sum b/go.sum
index 928c074..41936b4 100644
--- a/go.sum
+++ b/go.sum
@@ -116,6 +116,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/creack/pty v1.1.15 h1:cKRCLMj3Ddm54bKSpemfQ8AtYFBhAI2MPmdys22fBdc=
 github.com/creack/pty v1.1.15/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
+github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
+github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/pkg/system/dup.go b/pkg/system/dup.go
index 4fee401..8270f05 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 0000000..74d633e
--- /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)
+}
