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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [syscall/] [syscall_errno.go] - Blame information for rev 747

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
package syscall
6
 
7
// An Errno is an unsigned number describing an error condition.
8
// It implements the error interface.  The zero Errno is by convention
9
// a non-error, so code to convert from Errno to error should use:
10
//      err = nil
11
//      if errno != 0 {
12
//              err = errno
13
//      }
14
type Errno uintptr
15
 
16
func (e Errno) Error() string {
17
        return Errstr(int(e))
18
}
19
 
20
func (e Errno) Temporary() bool {
21
        return e == EINTR || e == EMFILE || e.Timeout()
22
}
23
 
24
func (e Errno) Timeout() bool {
25
        return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT
26
}

powered by: WebSVN 2.1.0

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