github.com/tcnksm/go@v0.0.0-20141208075154-439b32936367/src/syscall/tables_nacl.go (about)

     1  // Copyright 2013 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  // TODO: generate with runtime/mknacl.sh, allow override with IRT.
     8  const (
     9  	sys_null                 = 1
    10  	sys_nameservice          = 2
    11  	sys_dup                  = 8
    12  	sys_dup2                 = 9
    13  	sys_open                 = 10
    14  	sys_close                = 11
    15  	sys_read                 = 12
    16  	sys_write                = 13
    17  	sys_lseek                = 14
    18  	sys_ioctl                = 15
    19  	sys_stat                 = 16
    20  	sys_fstat                = 17
    21  	sys_chmod                = 18
    22  	sys_brk                  = 20
    23  	sys_mmap                 = 21
    24  	sys_munmap               = 22
    25  	sys_getdents             = 23
    26  	sys_mprotect             = 24
    27  	sys_list_mappings        = 25
    28  	sys_exit                 = 30
    29  	sys_getpid               = 31
    30  	sys_sched_yield          = 32
    31  	sys_sysconf              = 33
    32  	sys_gettimeofday         = 40
    33  	sys_clock                = 41
    34  	sys_nanosleep            = 42
    35  	sys_clock_getres         = 43
    36  	sys_clock_gettime        = 44
    37  	sys_mkdir                = 45
    38  	sys_rmdir                = 46
    39  	sys_chdir                = 47
    40  	sys_getcwd               = 48
    41  	sys_unlink               = 49
    42  	sys_imc_makeboundsock    = 60
    43  	sys_imc_accept           = 61
    44  	sys_imc_connect          = 62
    45  	sys_imc_sendmsg          = 63
    46  	sys_imc_recvmsg          = 64
    47  	sys_imc_mem_obj_create   = 65
    48  	sys_imc_socketpair       = 66
    49  	sys_mutex_create         = 70
    50  	sys_mutex_lock           = 71
    51  	sys_mutex_trylock        = 72
    52  	sys_mutex_unlock         = 73
    53  	sys_cond_create          = 74
    54  	sys_cond_wait            = 75
    55  	sys_cond_signal          = 76
    56  	sys_cond_broadcast       = 77
    57  	sys_cond_timed_wait_abs  = 79
    58  	sys_thread_create        = 80
    59  	sys_thread_exit          = 81
    60  	sys_tls_init             = 82
    61  	sys_thread_nice          = 83
    62  	sys_tls_get              = 84
    63  	sys_second_tls_set       = 85
    64  	sys_second_tls_get       = 86
    65  	sys_exception_handler    = 87
    66  	sys_exception_stack      = 88
    67  	sys_exception_clear_flag = 89
    68  	sys_sem_create           = 100
    69  	sys_sem_wait             = 101
    70  	sys_sem_post             = 102
    71  	sys_sem_get_value        = 103
    72  	sys_dyncode_create       = 104
    73  	sys_dyncode_modify       = 105
    74  	sys_dyncode_delete       = 106
    75  	sys_test_infoleak        = 109
    76  	sys_test_crash           = 110
    77  	sys_test_syscall_1       = 111
    78  	sys_test_syscall_2       = 112
    79  )
    80  
    81  // TODO: Auto-generate some day. (Hard-coded in binaries so not likely to change.)
    82  const (
    83  	// native_client/src/trusted/service_runtime/include/sys/errno.h
    84  	// The errors are mainly copied from Linux.
    85  	EPERM           Errno = 1       /* Operation not permitted */
    86  	ENOENT          Errno = 2       /* No such file or directory */
    87  	ESRCH           Errno = 3       /* No such process */
    88  	EINTR           Errno = 4       /* Interrupted system call */
    89  	EIO             Errno = 5       /* I/O error */
    90  	ENXIO           Errno = 6       /* No such device or address */
    91  	E2BIG           Errno = 7       /* Argument list too long */
    92  	ENOEXEC         Errno = 8       /* Exec format error */
    93  	EBADF           Errno = 9       /* Bad file number */
    94  	ECHILD          Errno = 10      /* No child processes */
    95  	EAGAIN          Errno = 11      /* Try again */
    96  	ENOMEM          Errno = 12      /* Out of memory */
    97  	EACCES          Errno = 13      /* Permission denied */
    98  	EFAULT          Errno = 14      /* Bad address */
    99  	EBUSY           Errno = 16      /* Device or resource busy */
   100  	EEXIST          Errno = 17      /* File exists */
   101  	EXDEV           Errno = 18      /* Cross-device link */
   102  	ENODEV          Errno = 19      /* No such device */
   103  	ENOTDIR         Errno = 20      /* Not a directory */
   104  	EISDIR          Errno = 21      /* Is a directory */
   105  	EINVAL          Errno = 22      /* Invalid argument */
   106  	ENFILE          Errno = 23      /* File table overflow */
   107  	EMFILE          Errno = 24      /* Too many open files */
   108  	ENOTTY          Errno = 25      /* Not a typewriter */
   109  	EFBIG           Errno = 27      /* File too large */
   110  	ENOSPC          Errno = 28      /* No space left on device */
   111  	ESPIPE          Errno = 29      /* Illegal seek */
   112  	EROFS           Errno = 30      /* Read-only file system */
   113  	EMLINK          Errno = 31      /* Too many links */
   114  	EPIPE           Errno = 32      /* Broken pipe */
   115  	ENAMETOOLONG    Errno = 36      /* File name too long */
   116  	ENOSYS          Errno = 38      /* Function not implemented */
   117  	EDQUOT          Errno = 122     /* Quota exceeded */
   118  	EDOM            Errno = 33      /* Math arg out of domain of func */
   119  	ERANGE          Errno = 34      /* Math result not representable */
   120  	EDEADLK         Errno = 35      /* Deadlock condition */
   121  	ENOLCK          Errno = 37      /* No record locks available */
   122  	ENOTEMPTY       Errno = 39      /* Directory not empty */
   123  	ELOOP           Errno = 40      /* Too many symbolic links */
   124  	ENOMSG          Errno = 42      /* No message of desired type */
   125  	EIDRM           Errno = 43      /* Identifier removed */
   126  	ECHRNG          Errno = 44      /* Channel number out of range */
   127  	EL2NSYNC        Errno = 45      /* Level 2 not synchronized */
   128  	EL3HLT          Errno = 46      /* Level 3 halted */
   129  	EL3RST          Errno = 47      /* Level 3 reset */
   130  	ELNRNG          Errno = 48      /* Link number out of range */
   131  	EUNATCH         Errno = 49      /* Protocol driver not attached */
   132  	ENOCSI          Errno = 50      /* No CSI structure available */
   133  	EL2HLT          Errno = 51      /* Level 2 halted */
   134  	EBADE           Errno = 52      /* Invalid exchange */
   135  	EBADR           Errno = 53      /* Invalid request descriptor */
   136  	EXFULL          Errno = 54      /* Exchange full */
   137  	ENOANO          Errno = 55      /* No anode */
   138  	EBADRQC         Errno = 56      /* Invalid request code */
   139  	EBADSLT         Errno = 57      /* Invalid slot */
   140  	EDEADLOCK       Errno = EDEADLK /* File locking deadlock error */
   141  	EBFONT          Errno = 59      /* Bad font file fmt */
   142  	ENOSTR          Errno = 60      /* Device not a stream */
   143  	ENODATA         Errno = 61      /* No data (for no delay io) */
   144  	ETIME           Errno = 62      /* Timer expired */
   145  	ENOSR           Errno = 63      /* Out of streams resources */
   146  	ENONET          Errno = 64      /* Machine is not on the network */
   147  	ENOPKG          Errno = 65      /* Package not installed */
   148  	EREMOTE         Errno = 66      /* The object is remote */
   149  	ENOLINK         Errno = 67      /* The link has been severed */
   150  	EADV            Errno = 68      /* Advertise error */
   151  	ESRMNT          Errno = 69      /* Srmount error */
   152  	ECOMM           Errno = 70      /* Communication error on send */
   153  	EPROTO          Errno = 71      /* Protocol error */
   154  	EMULTIHOP       Errno = 72      /* Multihop attempted */
   155  	EDOTDOT         Errno = 73      /* Cross mount point (not really error) */
   156  	EBADMSG         Errno = 74      /* Trying to read unreadable message */
   157  	EOVERFLOW       Errno = 75      /* Value too large for defined data type */
   158  	ENOTUNIQ        Errno = 76      /* Given log. name not unique */
   159  	EBADFD          Errno = 77      /* f.d. invalid for this operation */
   160  	EREMCHG         Errno = 78      /* Remote address changed */
   161  	ELIBACC         Errno = 79      /* Can't access a needed shared lib */
   162  	ELIBBAD         Errno = 80      /* Accessing a corrupted shared lib */
   163  	ELIBSCN         Errno = 81      /* .lib section in a.out corrupted */
   164  	ELIBMAX         Errno = 82      /* Attempting to link in too many libs */
   165  	ELIBEXEC        Errno = 83      /* Attempting to exec a shared library */
   166  	EILSEQ          Errno = 84
   167  	EUSERS          Errno = 87
   168  	ENOTSOCK        Errno = 88  /* Socket operation on non-socket */
   169  	EDESTADDRREQ    Errno = 89  /* Destination address required */
   170  	EMSGSIZE        Errno = 90  /* Message too long */
   171  	EPROTOTYPE      Errno = 91  /* Protocol wrong type for socket */
   172  	ENOPROTOOPT     Errno = 92  /* Protocol not available */
   173  	EPROTONOSUPPORT Errno = 93  /* Unknown protocol */
   174  	ESOCKTNOSUPPORT Errno = 94  /* Socket type not supported */
   175  	EOPNOTSUPP      Errno = 95  /* Operation not supported on transport endpoint */
   176  	EPFNOSUPPORT    Errno = 96  /* Protocol family not supported */
   177  	EAFNOSUPPORT    Errno = 97  /* Address family not supported by protocol family */
   178  	EADDRINUSE      Errno = 98  /* Address already in use */
   179  	EADDRNOTAVAIL   Errno = 99  /* Address not available */
   180  	ENETDOWN        Errno = 100 /* Network interface is not configured */
   181  	ENETUNREACH     Errno = 101 /* Network is unreachable */
   182  	ENETRESET       Errno = 102
   183  	ECONNABORTED    Errno = 103 /* Connection aborted */
   184  	ECONNRESET      Errno = 104 /* Connection reset by peer */
   185  	ENOBUFS         Errno = 105 /* No buffer space available */
   186  	EISCONN         Errno = 106 /* Socket is already connected */
   187  	ENOTCONN        Errno = 107 /* Socket is not connected */
   188  	ESHUTDOWN       Errno = 108 /* Can't send after socket shutdown */
   189  	ETOOMANYREFS    Errno = 109
   190  	ETIMEDOUT       Errno = 110 /* Connection timed out */
   191  	ECONNREFUSED    Errno = 111 /* Connection refused */
   192  	EHOSTDOWN       Errno = 112 /* Host is down */
   193  	EHOSTUNREACH    Errno = 113 /* Host is unreachable */
   194  	EALREADY        Errno = 114 /* Socket already connected */
   195  	EINPROGRESS     Errno = 115 /* Connection already in progress */
   196  	ESTALE          Errno = 116
   197  	ENOTSUP         Errno = EOPNOTSUPP /* Not supported */
   198  	ENOMEDIUM       Errno = 123        /* No medium (in tape drive) */
   199  	ECANCELED       Errno = 125        /* Operation canceled. */
   200  	ELBIN           Errno = 2048       /* Inode is remote (not really error) */
   201  	EFTYPE          Errno = 2049       /* Inappropriate file type or format */
   202  	ENMFILE         Errno = 2050       /* No more files */
   203  	EPROCLIM        Errno = 2051
   204  	ENOSHARE        Errno = 2052   /* No such host or network path */
   205  	ECASECLASH      Errno = 2053   /* Filename exists with different case */
   206  	EWOULDBLOCK     Errno = EAGAIN /* Operation would block */
   207  )
   208  
   209  // TODO: Auto-generate some day. (Hard-coded in binaries so not likely to change.)
   210  var errorstr = [...]string{
   211  	EPERM:           "Operation not permitted",
   212  	ENOENT:          "No such file or directory",
   213  	ESRCH:           "No such process",
   214  	EINTR:           "Interrupted system call",
   215  	EIO:             "I/O error",
   216  	ENXIO:           "No such device or address",
   217  	E2BIG:           "Argument list too long",
   218  	ENOEXEC:         "Exec format error",
   219  	EBADF:           "Bad file number",
   220  	ECHILD:          "No child processes",
   221  	EAGAIN:          "Try again",
   222  	ENOMEM:          "Out of memory",
   223  	EACCES:          "Permission denied",
   224  	EFAULT:          "Bad address",
   225  	EBUSY:           "Device or resource busy",
   226  	EEXIST:          "File exists",
   227  	EXDEV:           "Cross-device link",
   228  	ENODEV:          "No such device",
   229  	ENOTDIR:         "Not a directory",
   230  	EISDIR:          "Is a directory",
   231  	EINVAL:          "Invalid argument",
   232  	ENFILE:          "File table overflow",
   233  	EMFILE:          "Too many open files",
   234  	ENOTTY:          "Not a typewriter",
   235  	EFBIG:           "File too large",
   236  	ENOSPC:          "No space left on device",
   237  	ESPIPE:          "Illegal seek",
   238  	EROFS:           "Read-only file system",
   239  	EMLINK:          "Too many links",
   240  	EPIPE:           "Broken pipe",
   241  	ENAMETOOLONG:    "File name too long",
   242  	ENOSYS:          "not implemented on Native Client",
   243  	EDQUOT:          "Quota exceeded",
   244  	EDOM:            "Math arg out of domain of func",
   245  	ERANGE:          "Math result not representable",
   246  	EDEADLK:         "Deadlock condition",
   247  	ENOLCK:          "No record locks available",
   248  	ENOTEMPTY:       "Directory not empty",
   249  	ELOOP:           "Too many symbolic links",
   250  	ENOMSG:          "No message of desired type",
   251  	EIDRM:           "Identifier removed",
   252  	ECHRNG:          "Channel number out of range",
   253  	EL2NSYNC:        "Level 2 not synchronized",
   254  	EL3HLT:          "Level 3 halted",
   255  	EL3RST:          "Level 3 reset",
   256  	ELNRNG:          "Link number out of range",
   257  	EUNATCH:         "Protocol driver not attached",
   258  	ENOCSI:          "No CSI structure available",
   259  	EL2HLT:          "Level 2 halted",
   260  	EBADE:           "Invalid exchange",
   261  	EBADR:           "Invalid request descriptor",
   262  	EXFULL:          "Exchange full",
   263  	ENOANO:          "No anode",
   264  	EBADRQC:         "Invalid request code",
   265  	EBADSLT:         "Invalid slot",
   266  	EBFONT:          "Bad font file fmt",
   267  	ENOSTR:          "Device not a stream",
   268  	ENODATA:         "No data (for no delay io)",
   269  	ETIME:           "Timer expired",
   270  	ENOSR:           "Out of streams resources",
   271  	ENONET:          "Machine is not on the network",
   272  	ENOPKG:          "Package not installed",
   273  	EREMOTE:         "The object is remote",
   274  	ENOLINK:         "The link has been severed",
   275  	EADV:            "Advertise error",
   276  	ESRMNT:          "Srmount error",
   277  	ECOMM:           "Communication error on send",
   278  	EPROTO:          "Protocol error",
   279  	EMULTIHOP:       "Multihop attempted",
   280  	EDOTDOT:         "Cross mount point (not really error)",
   281  	EBADMSG:         "Trying to read unreadable message",
   282  	EOVERFLOW:       "Value too large for defined data type",
   283  	ENOTUNIQ:        "Given log. name not unique",
   284  	EBADFD:          "f.d. invalid for this operation",
   285  	EREMCHG:         "Remote address changed",
   286  	ELIBACC:         "Can't access a needed shared lib",
   287  	ELIBBAD:         "Accessing a corrupted shared lib",
   288  	ELIBSCN:         ".lib section in a.out corrupted",
   289  	ELIBMAX:         "Attempting to link in too many libs",
   290  	ELIBEXEC:        "Attempting to exec a shared library",
   291  	ENOTSOCK:        "Socket operation on non-socket",
   292  	EDESTADDRREQ:    "Destination address required",
   293  	EMSGSIZE:        "Message too long",
   294  	EPROTOTYPE:      "Protocol wrong type for socket",
   295  	ENOPROTOOPT:     "Protocol not available",
   296  	EPROTONOSUPPORT: "Unknown protocol",
   297  	ESOCKTNOSUPPORT: "Socket type not supported",
   298  	EOPNOTSUPP:      "Operation not supported on transport endpoint",
   299  	EPFNOSUPPORT:    "Protocol family not supported",
   300  	EAFNOSUPPORT:    "Address family not supported by protocol family",
   301  	EADDRINUSE:      "Address already in use",
   302  	EADDRNOTAVAIL:   "Address not available",
   303  	ENETDOWN:        "Network interface is not configured",
   304  	ENETUNREACH:     "Network is unreachable",
   305  	ECONNABORTED:    "Connection aborted",
   306  	ECONNRESET:      "Connection reset by peer",
   307  	ENOBUFS:         "No buffer space available",
   308  	EISCONN:         "Socket is already connected",
   309  	ENOTCONN:        "Socket is not connected",
   310  	ESHUTDOWN:       "Can't send after socket shutdown",
   311  	ETIMEDOUT:       "Connection timed out",
   312  	ECONNREFUSED:    "Connection refused",
   313  	EHOSTDOWN:       "Host is down",
   314  	EHOSTUNREACH:    "Host is unreachable",
   315  	EALREADY:        "Socket already connected",
   316  	EINPROGRESS:     "Connection already in progress",
   317  	ENOMEDIUM:       "No medium (in tape drive)",
   318  	ECANCELED:       "Operation canceled.",
   319  	ELBIN:           "Inode is remote (not really error)",
   320  	EFTYPE:          "Inappropriate file type or format",
   321  	ENMFILE:         "No more files",
   322  	ENOSHARE:        "No such host or network path",
   323  	ECASECLASH:      "Filename exists with different case",
   324  }