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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [os/] [error_plan9.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 2011 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
package os
6
 
7
import (
8
        "errors"
9
        "syscall"
10
)
11
 
12
// SyscallError records an error from a specific system call.
13
type SyscallError struct {
14
        Syscall string
15
        Err     string
16
}
17
 
18
func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err }
19
 
20
// NewSyscallError returns, as an error, a new SyscallError
21
// with the given system call name and error details.
22
// As a convenience, if err is nil, NewSyscallError returns nil.
23
func NewSyscallError(syscall string, err error) error {
24
        if err == nil {
25
                return nil
26
        }
27
        return &SyscallError{syscall, err.Error()}
28
}
29
 
30
var (
31
        Eshortstat = errors.New("stat buffer too small")
32
        Ebadstat   = errors.New("malformed stat buffer")
33
        Ebadfd     = errors.New("fd out of range or not open")
34
        Ebadarg    = errors.New("bad arg in system call")
35
        Enotdir    = errors.New("not a directory")
36
        Enonexist  = errors.New("file does not exist")
37
        Eexist     = errors.New("file already exists")
38
        Eio        = errors.New("i/o error")
39
        Eperm      = errors.New("permission denied")
40
 
41
        EINVAL  = Ebadarg
42
        ENOTDIR = Enotdir
43
        ENOENT  = Enonexist
44
        EEXIST  = Eexist
45
        EIO     = Eio
46
        EACCES  = Eperm
47
        EPERM   = Eperm
48
        EISDIR  = syscall.EISDIR
49
 
50
        EBADF        = errors.New("bad file descriptor")
51
        ENAMETOOLONG = errors.New("file name too long")
52
        ERANGE       = errors.New("math result not representable")
53
        EPIPE        = errors.New("Broken Pipe")
54
        EPLAN9       = errors.New("not supported by plan 9")
55
)

powered by: WebSVN 2.1.0

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