Ready to release 0.6.0
[aya.git] / vendor / golang.org / x / sys / unix / syscall_linux_mips64x.go
blobbfef09a39eb06c97a8e280d3118c8e8e6497a8e3
1 // Copyright 2015 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 && (mips64 || mips64le)
6 // +build linux
7 // +build mips64 mips64le
9 package unix
11 //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
12 //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
13 //sys Fchown(fd int, uid int, gid int) (err error)
14 //sys Fstatfs(fd int, buf *Statfs_t) (err error)
15 //sys Ftruncate(fd int, length int64) (err error)
16 //sysnb Getegid() (egid int)
17 //sysnb Geteuid() (euid int)
18 //sysnb Getgid() (gid int)
19 //sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
20 //sysnb Getuid() (uid int)
21 //sys Lchown(path string, uid int, gid int) (err error)
22 //sys Listen(s int, n int) (err error)
23 //sys Pause() (err error)
24 //sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
25 //sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
26 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
27 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
29 func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
30 var ts *Timespec
31 if timeout != nil {
32 ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
34 return Pselect(nfd, r, w, e, ts, nil)
37 //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
38 //sys setfsgid(gid int) (prev int, err error)
39 //sys setfsuid(uid int) (prev int, err error)
40 //sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
41 //sys Shutdown(fd int, how int) (err error)
42 //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
43 //sys Statfs(path string, buf *Statfs_t) (err error)
44 //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
45 //sys Truncate(path string, length int64) (err error)
46 //sys Ustat(dev int, ubuf *Ustat_t) (err error)
47 //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
48 //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
49 //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
50 //sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
51 //sysnb setgroups(n int, list *_Gid_t) (err error)
52 //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
53 //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
54 //sysnb socket(domain int, typ int, proto int) (fd int, err error)
55 //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
56 //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
57 //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
58 //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
59 //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
60 //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
61 //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
62 //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
64 //sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
65 //sysnb Gettimeofday(tv *Timeval) (err error)
67 func Time(t *Time_t) (tt Time_t, err error) {
68 var tv Timeval
69 err = Gettimeofday(&tv)
70 if err != nil {
71 return 0, err
73 if t != nil {
74 *t = Time_t(tv.Sec)
76 return Time_t(tv.Sec), nil
79 //sys Utime(path string, buf *Utimbuf) (err error)
80 //sys utimes(path string, times *[2]Timeval) (err error)
82 func setTimespec(sec, nsec int64) Timespec {
83 return Timespec{Sec: sec, Nsec: nsec}
86 func setTimeval(sec, usec int64) Timeval {
87 return Timeval{Sec: sec, Usec: usec}
90 func Ioperm(from int, num int, on int) (err error) {
91 return ENOSYS
94 func Iopl(level int) (err error) {
95 return ENOSYS
98 type stat_t struct {
99 Dev uint32
100 Pad0 [3]int32
101 Ino uint64
102 Mode uint32
103 Nlink uint32
104 Uid uint32
105 Gid uint32
106 Rdev uint32
107 Pad1 [3]uint32
108 Size int64
109 Atime uint32
110 Atime_nsec uint32
111 Mtime uint32
112 Mtime_nsec uint32
113 Ctime uint32
114 Ctime_nsec uint32
115 Blksize uint32
116 Pad2 uint32
117 Blocks int64
120 //sys fstat(fd int, st *stat_t) (err error)
121 //sys fstatat(dirfd int, path string, st *stat_t, flags int) (err error) = SYS_NEWFSTATAT
122 //sys lstat(path string, st *stat_t) (err error)
123 //sys stat(path string, st *stat_t) (err error)
125 func Fstat(fd int, s *Stat_t) (err error) {
126 st := &stat_t{}
127 err = fstat(fd, st)
128 fillStat_t(s, st)
129 return
132 func Fstatat(dirfd int, path string, s *Stat_t, flags int) (err error) {
133 st := &stat_t{}
134 err = fstatat(dirfd, path, st, flags)
135 fillStat_t(s, st)
136 return
139 func Lstat(path string, s *Stat_t) (err error) {
140 st := &stat_t{}
141 err = lstat(path, st)
142 fillStat_t(s, st)
143 return
146 func Stat(path string, s *Stat_t) (err error) {
147 st := &stat_t{}
148 err = stat(path, st)
149 fillStat_t(s, st)
150 return
153 func fillStat_t(s *Stat_t, st *stat_t) {
154 s.Dev = st.Dev
155 s.Ino = st.Ino
156 s.Mode = st.Mode
157 s.Nlink = st.Nlink
158 s.Uid = st.Uid
159 s.Gid = st.Gid
160 s.Rdev = st.Rdev
161 s.Size = st.Size
162 s.Atim = Timespec{int64(st.Atime), int64(st.Atime_nsec)}
163 s.Mtim = Timespec{int64(st.Mtime), int64(st.Mtime_nsec)}
164 s.Ctim = Timespec{int64(st.Ctime), int64(st.Ctime_nsec)}
165 s.Blksize = st.Blksize
166 s.Blocks = st.Blocks
169 func (r *PtraceRegs) PC() uint64 { return r.Epc }
171 func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
173 func (iov *Iovec) SetLen(length int) {
174 iov.Len = uint64(length)
177 func (msghdr *Msghdr) SetControllen(length int) {
178 msghdr.Controllen = uint64(length)
181 func (msghdr *Msghdr) SetIovlen(length int) {
182 msghdr.Iovlen = uint64(length)
185 func (cmsg *Cmsghdr) SetLen(length int) {
186 cmsg.Len = uint64(length)
189 func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
190 rsa.Service_name_len = uint64(length)