Source file src/syscall/syscall_linux_ppc64x.go

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     5  //go:build linux && (ppc64 || ppc64le)
     7  package syscall
     9  const (
    10  	_SYS_setgroups  = SYS_SETGROUPS
    11  	_SYS_clone3     = 435
    12  	_SYS_faccessat2 = 439
    13  )
    15  //sys	Dup2(oldfd int, newfd int) (err error)
    16  //sys	EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    17  //sys	Fchown(fd int, uid int, gid int) (err error)
    18  //sys	Fstat(fd int, stat *Stat_t) (err error)
    19  //sys	fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
    20  //sys	Fstatfs(fd int, buf *Statfs_t) (err error)
    21  //sys	Ftruncate(fd int, length int64) (err error)
    22  //sysnb	Getegid() (egid int)
    23  //sysnb	Geteuid() (euid int)
    24  //sysnb	Getgid() (gid int)
    25  //sysnb	Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT
    26  //sysnb	Getuid() (uid int)
    27  //sysnb	InotifyInit() (fd int, err error)
    28  //sys	Ioperm(from int, num int, on int) (err error)
    29  //sys	Iopl(level int) (err error)
    30  //sys	Lchown(path string, uid int, gid int) (err error)
    31  //sys	Listen(s int, n int) (err error)
    32  //sys	Lstat(path string, stat *Stat_t) (err error)
    33  //sys	Pause() (err error)
    34  //sys	pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
    35  //sys	pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
    36  //sys	Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
    37  //sys	Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
    38  //sys	Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
    39  //sys	sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
    40  //sys	Setfsgid(gid int) (err error)
    41  //sys	Setfsuid(uid int) (err error)
    42  //sysnb	Setrlimit(resource int, rlim *Rlimit) (err error)
    43  //sys	Shutdown(fd int, how int) (err error)
    44  //sys	Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    45  //sys	Stat(path string, stat *Stat_t) (err error)
    46  //sys	Statfs(path string, buf *Statfs_t) (err error)
    47  //sys	Truncate(path string, length int64) (err error)
    48  //sys	Ustat(dev int, ubuf *Ustat_t) (err error)
    49  //sys	accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
    50  //sys	bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
    51  //sys	connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
    52  //sysnb	getgroups(n int, list *_Gid_t) (nn int, err error)
    53  //sys	getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
    54  //sys	setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
    55  //sysnb	socket(domain int, typ int, proto int) (fd int, err error)
    56  //sysnb	socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
    57  //sysnb	getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
    58  //sysnb	getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
    59  //sys	recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
    60  //sys	sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
    61  //sys	recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
    62  //sys	sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
    63  //sys	mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
    65  //sys	futimesat(dirfd int, path string, times *[2]Timeval) (err error)
    66  //sysnb	Gettimeofday(tv *Timeval) (err error)
    67  //sysnb	Time(t *Time_t) (tt Time_t, err error)
    68  //sys	Utime(path string, buf *Utimbuf) (err error)
    69  //sys	utimes(path string, times *[2]Timeval) (err error)
    71  func setTimespec(sec, nsec int64) Timespec {
    72  	return Timespec{Sec: sec, Nsec: nsec}
    73  }
    75  func setTimeval(sec, usec int64) Timeval {
    76  	return Timeval{Sec: sec, Usec: usec}
    77  }
    79  func (r *PtraceRegs) PC() uint64 { return r.Nip }
    81  func (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc }
    83  func (iov *Iovec) SetLen(length int) {
    84  	iov.Len = uint64(length)
    85  }
    87  func (msghdr *Msghdr) SetControllen(length int) {
    88  	msghdr.Controllen = uint64(length)
    89  }
    91  func (cmsg *Cmsghdr) SetLen(length int) {
    92  	cmsg.Len = uint64(length)
    93  }
    95  //sys	syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2
    97  func SyncFileRange(fd int, off int64, n int64, flags int) error {
    98  	// The sync_file_range and sync_file_range2 syscalls differ only in the
    99  	// order of their arguments.
   100  	return syncFileRange2(fd, flags, off, n)
   101  }

View as plain text