errors_plan9.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // 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. package plan9
  5. import "syscall"
  6. // Constants
  7. const (
  8. // Invented values to support what package os expects.
  9. O_CREAT = 0x02000
  10. O_APPEND = 0x00400
  11. O_NOCTTY = 0x00000
  12. O_NONBLOCK = 0x00000
  13. O_SYNC = 0x00000
  14. O_ASYNC = 0x00000
  15. S_IFMT = 0x1f000
  16. S_IFIFO = 0x1000
  17. S_IFCHR = 0x2000
  18. S_IFDIR = 0x4000
  19. S_IFBLK = 0x6000
  20. S_IFREG = 0x8000
  21. S_IFLNK = 0xa000
  22. S_IFSOCK = 0xc000
  23. )
  24. // Errors
  25. var (
  26. EINVAL = syscall.NewError("bad arg in system call")
  27. ENOTDIR = syscall.NewError("not a directory")
  28. EISDIR = syscall.NewError("file is a directory")
  29. ENOENT = syscall.NewError("file does not exist")
  30. EEXIST = syscall.NewError("file already exists")
  31. EMFILE = syscall.NewError("no free file descriptors")
  32. EIO = syscall.NewError("i/o error")
  33. ENAMETOOLONG = syscall.NewError("file name too long")
  34. EINTR = syscall.NewError("interrupted")
  35. EPERM = syscall.NewError("permission denied")
  36. EBUSY = syscall.NewError("no free devices")
  37. ETIMEDOUT = syscall.NewError("connection timed out")
  38. EPLAN9 = syscall.NewError("not supported by plan 9")
  39. // The following errors do not correspond to any
  40. // Plan 9 system messages. Invented to support
  41. // what package os and others expect.
  42. EACCES = syscall.NewError("access permission denied")
  43. EAFNOSUPPORT = syscall.NewError("address family not supported by protocol")
  44. )