PageRenderTime 27ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 1ms

/cddl/lib/libdtrace/errno.d

https://gitlab.com/HardenedBSD/hardenedBSD-stable
D | 348 lines | 313 code | 2 blank | 33 comment | 102 complexity | 84b120217f982182081156e375c03dc6 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1, AGPL-1.0, GPL-2.0, 0BSD, BSD-3-Clause, BSD-2-Clause, CC0-1.0, LGPL-2.0
  1. /*
  2. * CDDL HEADER START
  3. *
  4. * The contents of this file are subject to the terms of the
  5. * Common Development and Distribution License, Version 1.0 only
  6. * (the "License"). You may not use this file except in compliance
  7. * with the License.
  8. *
  9. * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10. * or http://www.opensolaris.org/os/licensing.
  11. * See the License for the specific language governing permissions
  12. * and limitations under the License.
  13. *
  14. * When distributing Covered Code, include this CDDL HEADER in each
  15. * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16. * If applicable, add the following below this CDDL HEADER, with the
  17. * fields enclosed by brackets "[]" replaced with your own identifying
  18. * information: Portions Copyright [yyyy] [name of copyright owner]
  19. *
  20. * CDDL HEADER END
  21. *
  22. * Portions Copyright 2006-2008 John Birrell jb@freebsd.org
  23. * Portions Copyright 2018 Devin Teske dteske@freebsd.org
  24. *
  25. * $FreeBSD$
  26. */
  27. /*
  28. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  29. * Use is subject to license terms.
  30. */
  31. inline int EPERM = 1;
  32. #pragma D binding "1.0" EPERM
  33. inline int ENOENT = 2;
  34. #pragma D binding "1.0" ENOENT
  35. inline int ESRCH = 3;
  36. #pragma D binding "1.0" ESRCH
  37. inline int EINTR = 4;
  38. #pragma D binding "1.0" EINTR
  39. inline int EIO = 5;
  40. #pragma D binding "1.0" EIO
  41. inline int ENXIO = 6;
  42. #pragma D binding "1.0" ENXIO
  43. inline int E2BIG = 7;
  44. #pragma D binding "1.0" E2BIG
  45. inline int ENOEXEC = 8;
  46. #pragma D binding "1.0" ENOEXEC
  47. inline int EBADF = 9;
  48. #pragma D binding "1.0" EBADF
  49. inline int ECHILD = 10;
  50. #pragma D binding "1.0" ECHILD
  51. inline int EDEADLK = 11;
  52. #pragma D binding "1.0" EDEADLK
  53. inline int ENOMEM = 12;
  54. #pragma D binding "1.0" ENOMEM
  55. inline int EACCES = 13;
  56. #pragma D binding "1.0" EACCES
  57. inline int EFAULT = 14;
  58. #pragma D binding "1.0" EFAULT
  59. inline int ENOTBLK = 15;
  60. #pragma D binding "1.0" ENOTBLK
  61. inline int EBUSY = 16;
  62. #pragma D binding "1.0" EBUSY
  63. inline int EEXIST = 17;
  64. #pragma D binding "1.0" EEXIST
  65. inline int EXDEV = 18;
  66. #pragma D binding "1.0" EXDEV
  67. inline int ENODEV = 19;
  68. #pragma D binding "1.0" ENODEV
  69. inline int ENOTDIR = 20;
  70. #pragma D binding "1.0" ENOTDIR
  71. inline int EISDIR = 21;
  72. #pragma D binding "1.0" EISDIR
  73. inline int EINVAL = 22;
  74. #pragma D binding "1.0" EINVAL
  75. inline int ENFILE = 23;
  76. #pragma D binding "1.0" ENFILE
  77. inline int EMFILE = 24;
  78. #pragma D binding "1.0" EMFILE
  79. inline int ENOTTY = 25;
  80. #pragma D binding "1.0" ENOTTY
  81. inline int ETXTBSY = 26;
  82. #pragma D binding "1.0" ETXTBSY
  83. inline int EFBIG = 27;
  84. #pragma D binding "1.0" EFBIG
  85. inline int ENOSPC = 28;
  86. #pragma D binding "1.0" ENOSPC
  87. inline int ESPIPE = 29;
  88. #pragma D binding "1.0" ESPIPE
  89. inline int EROFS = 30;
  90. #pragma D binding "1.0" EROFS
  91. inline int EMLINK = 31;
  92. #pragma D binding "1.0" EMLINK
  93. inline int EPIPE = 32;
  94. #pragma D binding "1.0" EPIPE
  95. inline int EDOM = 33;
  96. #pragma D binding "1.0" EDOM
  97. inline int ERANGE = 34;
  98. #pragma D binding "1.0" ERANGE
  99. inline int EAGAIN = 35;
  100. #pragma D binding "1.0" EAGAIN
  101. inline int EWOULDBLOCK = EAGAIN;
  102. #pragma D binding "1.0" EWOULDBLOCK
  103. inline int EINPROGRESS = 36;
  104. #pragma D binding "1.0" EINPROGRESS
  105. inline int EALREADY = 37;
  106. #pragma D binding "1.0" EALREADY
  107. inline int ENOTSOCK = 38;
  108. #pragma D binding "1.0" ENOTSOCK
  109. inline int EDESTADDRREQ = 39;
  110. #pragma D binding "1.0" EDESTADDRREQ
  111. inline int EMSGSIZE = 40;
  112. #pragma D binding "1.0" EMSGSIZE
  113. inline int EPROTOTYPE = 41;
  114. #pragma D binding "1.0" EPROTOTYPE
  115. inline int ENOPROTOOPT = 42;
  116. #pragma D binding "1.0" ENOPROTOOPT
  117. inline int EPROTONOSUPPORT = 43;
  118. #pragma D binding "1.0" EPROTONOSUPPORT
  119. inline int ESOCKTNOSUPPORT = 44;
  120. #pragma D binding "1.0" ESOCKTNOSUPPORT
  121. inline int EOPNOTSUPP = 45;
  122. #pragma D binding "1.0" EOPNOTSUPP
  123. inline int ENOTSUP = EOPNOTSUPP;
  124. #pragma D binding "1.0" ENOTSUP
  125. inline int EPFNOSUPPORT = 46;
  126. #pragma D binding "1.0" EPFNOSUPPORT
  127. inline int EAFNOSUPPORT = 47;
  128. #pragma D binding "1.0" EAFNOSUPPORT
  129. inline int EADDRINUSE = 48;
  130. #pragma D binding "1.0" EADDRINUSE
  131. inline int EADDRNOTAVAIL = 49;
  132. #pragma D binding "1.0" EADDRNOTAVAIL
  133. inline int ENETDOWN = 50;
  134. #pragma D binding "1.0" ENETDOWN
  135. inline int ENETUNREACH = 51;
  136. #pragma D binding "1.0" ENETUNREACH
  137. inline int ENETRESET = 52;
  138. #pragma D binding "1.0" ENETRESET
  139. inline int ECONNABORTED = 53;
  140. #pragma D binding "1.0" ECONNABORTED
  141. inline int ECONNRESET = 54;
  142. #pragma D binding "1.0" ECONNRESET
  143. inline int ENOBUFS = 55;
  144. #pragma D binding "1.0" ENOBUFS
  145. inline int EISCONN = 56;
  146. #pragma D binding "1.0" EISCONN
  147. inline int ENOTCONN = 57;
  148. #pragma D binding "1.0" ENOTCONN
  149. inline int ESHUTDOWN = 58;
  150. #pragma D binding "1.0" ESHUTDOWN
  151. inline int ETOOMANYREFS = 59;
  152. #pragma D binding "1.0" ETOOMANYREFS
  153. inline int ETIMEDOUT = 60;
  154. #pragma D binding "1.0" ETIMEDOUT
  155. inline int ECONNREFUSED = 61;
  156. #pragma D binding "1.0" ECONNREFUSED
  157. inline int ELOOP = 62;
  158. #pragma D binding "1.0" ELOOP
  159. inline int ENAMETOOLONG = 63;
  160. #pragma D binding "1.0" ENAMETOOLONG
  161. inline int EHOSTDOWN = 64;
  162. #pragma D binding "1.0" EHOSTDOWN
  163. inline int EHOSTUNREACH = 65;
  164. #pragma D binding "1.0" EHOSTUNREACH
  165. inline int ENOTEMPTY = 66;
  166. #pragma D binding "1.0" ENOTEMPTY
  167. inline int EPROCLIM = 67;
  168. #pragma D binding "1.0" EPROCLIM
  169. inline int EUSERS = 68;
  170. #pragma D binding "1.0" EUSERS
  171. inline int EDQUOT = 69;
  172. #pragma D binding "1.0" EDQUOT
  173. inline int ESTALE = 70;
  174. #pragma D binding "1.0" ESTALE
  175. inline int EREMOTE = 71;
  176. #pragma D binding "1.0" EREMOTE
  177. inline int EBADRPC = 72;
  178. #pragma D binding "1.0" EBADRPC
  179. inline int ERPCMISMATCH = 73;
  180. #pragma D binding "1.0" ERPCMISMATCH
  181. inline int EPROGUNAVAIL = 74;
  182. #pragma D binding "1.0" EPROGUNAVAIL
  183. inline int EPROGMISMATCH = 75;
  184. #pragma D binding "1.0" EPROGMISMATCH
  185. inline int EPROCUNAVAIL = 76;
  186. #pragma D binding "1.0" EPROCUNAVAIL
  187. inline int ENOLCK = 77;
  188. #pragma D binding "1.0" ENOLCK
  189. inline int ENOSYS = 78;
  190. #pragma D binding "1.0" ENOSYS
  191. inline int EFTYPE = 79;
  192. #pragma D binding "1.0" EFTYPE
  193. inline int EAUTH = 80;
  194. #pragma D binding "1.0" EAUTH
  195. inline int ENEEDAUTH = 81;
  196. #pragma D binding "1.0" ENEEDAUTH
  197. inline int EIDRM = 82;
  198. #pragma D binding "1.0" EIDRM
  199. inline int ENOMSG = 83;
  200. #pragma D binding "1.0" ENOMSG
  201. inline int EOVERFLOW = 84;
  202. #pragma D binding "1.0" EOVERFLOW
  203. inline int ECANCELED = 85;
  204. #pragma D binding "1.0" ECANCELED
  205. inline int EILSEQ = 86;
  206. #pragma D binding "1.0" EILSEQ
  207. inline int ENOATTR = 87;
  208. #pragma D binding "1.0" ENOATTR
  209. inline int EDOOFUS = 88;
  210. #pragma D binding "1.0" EDOOFUS
  211. inline int EBADMSG = 89;
  212. #pragma D binding "1.0" EBADMSG
  213. inline int EMULTIHOP = 90;
  214. #pragma D binding "1.0" EMULTIHOP
  215. inline int ENOLINK = 91;
  216. #pragma D binding "1.0" ENOLINK
  217. inline int EPROTO = 92;
  218. #pragma D binding "1.0" EPROTO
  219. inline int ENOTCAPABLE = 93;
  220. #pragma D binding "1.13" ENOTCAPABLE
  221. inline int ECAPMODE = 94;
  222. #pragma D binding "1.13" ECAPMODE
  223. inline int ENOTRECOVERABLE = 95;
  224. #pragma D binding "1.13" ENOTRECOVERABLE
  225. inline int EOWNERDEAD = 96;
  226. #pragma D binding "1.13" EOWNERDEAD
  227. inline int ELAST = 96;
  228. #pragma D binding "1.0" ELAST
  229. inline int ERESTART = -1;
  230. #pragma D binding "1.0" ERESTART
  231. inline int EJUSTRETURN = -2;
  232. #pragma D binding "1.0" EJUSTRETURN
  233. inline int ENOIOCTL = -3;
  234. #pragma D binding "1.0" ENOIOCTL
  235. inline int EDIRIOCTL = -4;
  236. #pragma D binding "1.0" EDIRIOCTL
  237. inline int ERELOOKUP = -5;
  238. #pragma D binding "1.13" ERELOOKUP
  239. /*
  240. * Error strings from <sys/errno.h>
  241. */
  242. #pragma D binding "1.13" strerror
  243. inline string strerror[int errno] =
  244. errno == 0 ? "Success" :
  245. errno == EPERM ? "Operation not permitted" :
  246. errno == ENOENT ? "No such file or directory" :
  247. errno == ESRCH ? "No such process" :
  248. errno == EINTR ? "Interrupted system call" :
  249. errno == EIO ? "Input/output error" :
  250. errno == ENXIO ? "Device not configured" :
  251. errno == E2BIG ? "Argument list too long" :
  252. errno == ENOEXEC ? "Exec format error" :
  253. errno == EBADF ? "Bad file descriptor" :
  254. errno == ECHILD ? "No child processes" :
  255. errno == EDEADLK ? "Resource deadlock avoided" :
  256. errno == ENOMEM ? "Cannot allocate memory" :
  257. errno == EACCES ? "Permission denied" :
  258. errno == EFAULT ? "Bad address" :
  259. errno == ENOTBLK ? "Block device required" :
  260. errno == EBUSY ? "Device busy" :
  261. errno == EEXIST ? "File exists" :
  262. errno == EXDEV ? "Cross-device link" :
  263. errno == ENODEV ? "Operation not supported by device" :
  264. errno == ENOTDIR ? "Not a directory" :
  265. errno == EISDIR ? "Is a directory" :
  266. errno == EINVAL ? "Invalid argument" :
  267. errno == ENFILE ? "Too many open files in system" :
  268. errno == EMFILE ? "Too many open files" :
  269. errno == ENOTTY ? "Inappropriate ioctl for device" :
  270. errno == ETXTBSY ? "Text file busy" :
  271. errno == EFBIG ? "File too large" :
  272. errno == ENOSPC ? "No space left on device" :
  273. errno == ESPIPE ? "Illegal seek" :
  274. errno == EROFS ? "Read-only filesystem" :
  275. errno == EMLINK ? "Too many links" :
  276. errno == EPIPE ? "Broken pipe" :
  277. errno == EDOM ? "Numerical argument out of domain" :
  278. errno == ERANGE ? "Result too large" :
  279. errno == EAGAIN ? "Resource temporarily unavailable" :
  280. errno == EINPROGRESS ? "Operation now in progress" :
  281. errno == EALREADY ? "Operation already in progress" :
  282. errno == ENOTSOCK ? "Socket operation on non-socket" :
  283. errno == EDESTADDRREQ ? "Destination address required" :
  284. errno == EMSGSIZE ? "Message too long" :
  285. errno == EPROTOTYPE ? "Protocol wrong type for socket" :
  286. errno == ENOPROTOOPT ? "Protocol not available" :
  287. errno == EPROTONOSUPPORT ? "Protocol not supported" :
  288. errno == ESOCKTNOSUPPORT ? "Socket type not supported" :
  289. errno == EOPNOTSUPP ? "Operation not supported" :
  290. errno == EPFNOSUPPORT ? "Protocol family not supported" :
  291. errno == EAFNOSUPPORT ? "Address family not supported by protocol family" :
  292. errno == EADDRINUSE ? "Address already in use" :
  293. errno == EADDRNOTAVAIL ? "Can't assign requested address" :
  294. errno == ENETDOWN ? "Network is down" :
  295. errno == ENETUNREACH ? "Network is unreachable" :
  296. errno == ENETRESET ? "Network dropped connection on reset" :
  297. errno == ECONNABORTED ? "Software caused connection abort" :
  298. errno == ECONNRESET ? "Connection reset by peer" :
  299. errno == ENOBUFS ? "No buffer space available" :
  300. errno == EISCONN ? "Socket is already connected" :
  301. errno == ENOTCONN ? "Socket is not connected" :
  302. errno == ESHUTDOWN ? "Can't send after socket shutdown" :
  303. errno == ETOOMANYREFS ? "Too many references: can't splice" :
  304. errno == ETIMEDOUT ? "Operation timed out" :
  305. errno == ECONNREFUSED ? "Connection refused" :
  306. errno == ELOOP ? "Too many levels of symbolic links" :
  307. errno == ENAMETOOLONG ? "File name too long" :
  308. errno == EHOSTDOWN ? "Host is down" :
  309. errno == EHOSTUNREACH ? "No route to host" :
  310. errno == ENOTEMPTY ? "Directory not empty" :
  311. errno == EPROCLIM ? "Too many processes" :
  312. errno == EUSERS ? "Too many users" :
  313. errno == EDQUOT ? "Disc quota exceeded" :
  314. errno == ESTALE ? "Stale NFS file handle" :
  315. errno == EREMOTE ? "Too many levels of remote in path" :
  316. errno == EBADRPC ? "RPC struct is bad" :
  317. errno == ERPCMISMATCH ? "RPC version wrong" :
  318. errno == EPROGUNAVAIL ? "RPC prog. not avail" :
  319. errno == EPROGMISMATCH ? "Program version wrong" :
  320. errno == EPROCUNAVAIL ? "Bad procedure for program" :
  321. errno == ENOLCK ? "No locks available" :
  322. errno == ENOSYS ? "Function not implemented" :
  323. errno == EFTYPE ? "Inappropriate file type or format" :
  324. errno == EAUTH ? "Authentication error" :
  325. errno == ENEEDAUTH ? "Need authenticator" :
  326. errno == EIDRM ? "Identifier removed" :
  327. errno == ENOMSG ? "No message of desired type" :
  328. errno == EOVERFLOW ? "Value too large to be stored in data type" :
  329. errno == ECANCELED ? "Operation canceled" :
  330. errno == EILSEQ ? "Illegal byte sequence" :
  331. errno == ENOATTR ? "Attribute not found" :
  332. errno == EDOOFUS ? "Programming error" :
  333. errno == EBADMSG ? "Bad message" :
  334. errno == EMULTIHOP ? "Multihop attempted" :
  335. errno == ENOLINK ? "Link has been severed" :
  336. errno == EPROTO ? "Protocol error" :
  337. errno == ENOTCAPABLE ? "Capabilities insufficient" :
  338. errno == ECAPMODE ? "Not permitted in capability mode" :
  339. errno == ENOTRECOVERABLE ? "State not recoverable" :
  340. errno == EOWNERDEAD ? "Previous owner died" :
  341. errno == ERESTART ? "restart syscall" :
  342. errno == EJUSTRETURN ? "don't modify regs, just return" :
  343. errno == ENOIOCTL ? "ioctl not handled by this layer" :
  344. errno == EDIRIOCTL ? "do direct ioctl in GEOM" :
  345. errno == ERELOOKUP ? "retry the directory lookup" :
  346. "Unknown error";