Example #1
0
                            private static (long, syscall.Errno) seek(long fd, long offset, long whence)
                            {
                                long _p0 = default;

                                syscall.Errno _p0 = default;

                                ref long newoffset  = ref heap(out ptr <long> _addr_newoffset);
Example #2
0
                            public static (System.UIntPtr, System.UIntPtr, syscall.Errno) RawSyscall6(System.UIntPtr trap, System.UIntPtr a1, System.UIntPtr a2, System.UIntPtr a3, System.UIntPtr a4, System.UIntPtr a5, System.UIntPtr a6)
                            {
                                System.UIntPtr r1  = default;
                                System.UIntPtr r2  = default;
                                syscall.Errno  err = default;

                                return(syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6));
                            }
Example #3
0
                            public static (System.UIntPtr, System.UIntPtr, syscall.Errno) RawSyscall(System.UIntPtr trap, System.UIntPtr a1, System.UIntPtr a2, System.UIntPtr a3)
                            {
                                System.UIntPtr r1  = default;
                                System.UIntPtr r2  = default;
                                syscall.Errno  err = default;

                                return(syscall.RawSyscall(trap, a1, a2, a3));
                            }
Example #4
0
File: gccgo.cs Project: zjmit/go2cs
                            public static (System.UIntPtr, System.UIntPtr, syscall.Errno) RawSyscall(System.UIntPtr trap, System.UIntPtr a1, System.UIntPtr a2, System.UIntPtr a3)
                            {
                                System.UIntPtr r1  = default;
                                System.UIntPtr r2  = default;
                                syscall.Errno  err = default;

                                var(r, errno) = realSyscall(trap, a1, a2, a3, 0L, 0L, 0L, 0L, 0L, 0L);
                                return(r, 0L, syscall.Errno(errno));
                            }
Example #5
0
File: gccgo.cs Project: zjmit/go2cs
                            public static (System.UIntPtr, System.UIntPtr, syscall.Errno) Syscall9(System.UIntPtr trap, System.UIntPtr a1, System.UIntPtr a2, System.UIntPtr a3, System.UIntPtr a4, System.UIntPtr a5, System.UIntPtr a6, System.UIntPtr a7, System.UIntPtr a8, System.UIntPtr a9)
                            {
                                System.UIntPtr r1  = default;
                                System.UIntPtr r2  = default;
                                syscall.Errno  err = default;

                                syscall.Entersyscall();
                                var(r, errno) = realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
                                syscall.Exitsyscall();
                                return(r, 0L, syscall.Errno(errno));
                            }
Example #6
0
                            // ErrnoName returns the error name for error number e.
                            public static @string ErrnoName(syscall.Errno e)
                            {
                                var i = sort.Search(len(errorList), i =>
                                {
                                    return(errorList[i].num >= e);
                                });

                                if (i < len(errorList) && errorList[i].num == e)
                                {
                                    return(errorList[i].name);
                                }

                                return("");
                            }
Example #7
0
 // errnoErr returns common boxed Errno values, to prevent
 // allocations at runtime.
 private static error errnoErr(syscall.Errno e)
 {
     if (e == 0L)
     {
         return(error.As(null !) !);
     }
     else if (e == errnoERROR_IO_PENDING)
     {
         return(error.As(errERROR_IO_PENDING) !);
     }
     // TODO: add more here, after collecting data on the common
     // error values see on Windows. (perhaps when running
     // all.bat?)
     return(error.As(e) !);
 }
Example #8
0
 // errnoErr returns common boxed Errno values, to prevent
 // allocations at runtime.
 private static error errnoErr(syscall.Errno e)
 {
     if (e == 0L)
     {
         return(error.As(null !) !);
     }
     else if (e == syscall.EAGAIN)
     {
         return(error.As(errEAGAIN) !);
     }
     else if (e == syscall.EINVAL)
     {
         return(error.As(errEINVAL) !);
     }
     else if (e == syscall.ENOENT)
     {
         return(error.As(errENOENT) !);
     }
     return(error.As(e) !);
 }
Example #9
0
 public PtyError(@string FuncName = default, @string ErrorString = default, syscall.Errno Errno = default)
 {
     this.FuncName    = FuncName;
     this.ErrorString = ErrorString;
     this.Errno       = Errno;
 }