1
0
mirror of https://github.com/golang/go synced 2024-11-07 09:26:11 -07:00
go/misc/cgo/testcshared/testdata/libgo2/dup3.go
Joel Sing 6458b2e8db all: add support for c-archive and c-shared on linux/riscv64
This provides the runtime glue (_rt0_riscv64_linux_lib) for c-archive and c-shared
support, along with enabling both of these buildmodes on linux/riscv64.

Both misc/cgo/testcarchive and misc/cgo/testcshared now pass on this platform.

Fixes #47100

Change-Id: I7ad75b23ae1d592dbac60d15bba557668287711f
Reviewed-on: https://go-review.googlesource.com/c/go/+/334872
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-11-03 09:23:34 +00:00

14 lines
305 B
Go

// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux,arm64 linux,riscv64
package main
import "syscall"
func dup2(oldfd, newfd int) error {
return syscall.Dup3(oldfd, newfd, 0)
}