OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [os/] [error_posix.go] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// 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.
4
 
5
// +build darwin freebsd linux netbsd openbsd windows
6
 
7
package os
8
 
9
import syscall "syscall"
10
 
11
// Commonly known Unix errors.
12
var (
13
        EPERM        error = syscall.EPERM
14
        ENOENT       error = syscall.ENOENT
15
        ESRCH        error = syscall.ESRCH
16
        EINTR        error = syscall.EINTR
17
        EIO          error = syscall.EIO
18
        ENXIO        error = syscall.ENXIO
19
        E2BIG        error = syscall.E2BIG
20
        ENOEXEC      error = syscall.ENOEXEC
21
        EBADF        error = syscall.EBADF
22
        ECHILD       error = syscall.ECHILD
23
        EDEADLK      error = syscall.EDEADLK
24
        ENOMEM       error = syscall.ENOMEM
25
        EACCES       error = syscall.EACCES
26
        EFAULT       error = syscall.EFAULT
27
        EBUSY        error = syscall.EBUSY
28
        EEXIST       error = syscall.EEXIST
29
        EXDEV        error = syscall.EXDEV
30
        ENODEV       error = syscall.ENODEV
31
        ENOTDIR      error = syscall.ENOTDIR
32
        EISDIR       error = syscall.EISDIR
33
        EINVAL       error = syscall.EINVAL
34
        ENFILE       error = syscall.ENFILE
35
        EMFILE       error = syscall.EMFILE
36
        ENOTTY       error = syscall.ENOTTY
37
        EFBIG        error = syscall.EFBIG
38
        ENOSPC       error = syscall.ENOSPC
39
        ESPIPE       error = syscall.ESPIPE
40
        EROFS        error = syscall.EROFS
41
        EMLINK       error = syscall.EMLINK
42
        EPIPE        error = syscall.EPIPE
43
        EAGAIN       error = syscall.EAGAIN
44
        EDOM         error = syscall.EDOM
45
        ERANGE       error = syscall.ERANGE
46
        EADDRINUSE   error = syscall.EADDRINUSE
47
        ECONNREFUSED error = syscall.ECONNREFUSED
48
        ENAMETOOLONG error = syscall.ENAMETOOLONG
49
        EAFNOSUPPORT error = syscall.EAFNOSUPPORT
50
        ETIMEDOUT    error = syscall.ETIMEDOUT
51
        ENOTCONN     error = syscall.ENOTCONN
52
)
53
 
54
// SyscallError records an error from a specific system call.
55
type SyscallError struct {
56
        Syscall string
57
        Errno   error
58
}
59
 
60
func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Errno.Error() }
61
 
62
// NewSyscallError returns, as an error, a new SyscallError
63
// with the given system call name and error details.
64
// As a convenience, if err is nil, NewSyscallError returns nil.
65
func NewSyscallError(syscall string, err error) error {
66
        if err == nil {
67
                return nil
68
        }
69
        return &SyscallError{syscall, err}
70
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.