vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
changeset 256 6d9efbef00a9
parent 251 1c52a0eeb952
child 260 445e01aede7e
equal deleted inserted replaced
255:4f153a23adab 256:6d9efbef00a9
     1 // Copyright 2018 The Go Authors. All rights reserved.
     1 // Copyright 2018 The Go Authors. All rights reserved.
     2 // Use of this source code is governed by a BSD-style
     2 // Use of this source code is governed by a BSD-style
     3 // license that can be found in the LICENSE file.
     3 // license that can be found in the LICENSE file.
     4 
     4 
       
     5 //go:build riscv64 && linux
     5 // +build riscv64,linux
     6 // +build riscv64,linux
     6 
     7 
     7 package unix
     8 package unix
     8 
     9 
     9 import "unsafe"
    10 import "unsafe"
   152 	p[0] = int(pp[0])
   153 	p[0] = int(pp[0])
   153 	p[1] = int(pp[1])
   154 	p[1] = int(pp[1])
   154 	return
   155 	return
   155 }
   156 }
   156 
   157 
   157 //sysnb pipe2(p *[2]_C_int, flags int) (err error)
   158 //sysnb	pipe2(p *[2]_C_int, flags int) (err error)
   158 
   159 
   159 func Pipe2(p []int, flags int) (err error) {
   160 func Pipe2(p []int, flags int) (err error) {
   160 	if len(p) != 2 {
   161 	if len(p) != 2 {
   161 		return EINVAL
   162 		return EINVAL
   162 	}
   163 	}
   185 
   186 
   186 func (cmsg *Cmsghdr) SetLen(length int) {
   187 func (cmsg *Cmsghdr) SetLen(length int) {
   187 	cmsg.Len = uint64(length)
   188 	cmsg.Len = uint64(length)
   188 }
   189 }
   189 
   190 
       
   191 func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
       
   192 	rsa.Service_name_len = uint64(length)
       
   193 }
       
   194 
   190 func InotifyInit() (fd int, err error) {
   195 func InotifyInit() (fd int, err error) {
   191 	return InotifyInit1(0)
   196 	return InotifyInit1(0)
   192 }
       
   193 
       
   194 func Dup2(oldfd int, newfd int) (err error) {
       
   195 	return Dup3(oldfd, newfd, 0)
       
   196 }
   197 }
   197 
   198 
   198 func Pause() error {
   199 func Pause() error {
   199 	_, err := ppoll(nil, 0, nil, nil)
   200 	_, err := ppoll(nil, 0, nil, nil)
   200 	return err
   201 	return err
   226 		// syscall expects a NULL-terminated string.
   227 		// syscall expects a NULL-terminated string.
   227 		cmdlineLen++
   228 		cmdlineLen++
   228 	}
   229 	}
   229 	return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
   230 	return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
   230 }
   231 }
       
   232 
       
   233 // dup2 exists because func Dup3 in syscall_linux.go references
       
   234 // it in an unreachable path. dup2 isn't available on arm64.
       
   235 func dup2(oldfd int, newfd int) error