errno.texi 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642
  1. @node Error Reporting, Memory, Introduction, Top
  2. @chapter Error Reporting
  3. @c %MENU% How library functions report errors
  4. @cindex error reporting
  5. @cindex reporting errors
  6. @cindex error codes
  7. @cindex status codes
  8. Many functions in @theglibc{} detect and report error conditions,
  9. and sometimes your programs need to check for these error conditions.
  10. For example, when you open an input file, you should verify that the
  11. file was actually opened correctly, and print an error message or take
  12. other appropriate action if the call to the library function failed.
  13. This chapter describes how the error reporting facility works. Your
  14. program should include the header file @file{errno.h} to use this
  15. facility.
  16. @pindex errno.h
  17. @menu
  18. * Checking for Errors:: How errors are reported by library functions.
  19. * Error Codes:: Error code macros; all of these expand
  20. into integer constant values.
  21. * Error Messages:: Mapping error codes onto error messages.
  22. @end menu
  23. @node Checking for Errors, Error Codes, , Error Reporting
  24. @section Checking for Errors
  25. Most library functions return a special value to indicate that they have
  26. failed. The special value is typically @code{-1}, a null pointer, or a
  27. constant such as @code{EOF} that is defined for that purpose. But this
  28. return value tells you only that an error has occurred. To find out
  29. what kind of error it was, you need to look at the error code stored in the
  30. variable @code{errno}. This variable is declared in the header file
  31. @file{errno.h}.
  32. @pindex errno.h
  33. @deftypevr {Variable} {volatile int} errno
  34. @standards{ISO, errno.h}
  35. The variable @code{errno} contains the system error number. You can
  36. change the value of @code{errno}.
  37. Since @code{errno} is declared @code{volatile}, it might be changed
  38. asynchronously by a signal handler; see @ref{Defining Handlers}.
  39. However, a properly written signal handler saves and restores the value
  40. of @code{errno}, so you generally do not need to worry about this
  41. possibility except when writing signal handlers.
  42. The initial value of @code{errno} at program startup is zero. In many
  43. cases, when a library function encounters an error, it will set
  44. @code{errno} to a non-zero value to indicate what specific error
  45. condition occurred. The documentation for each function lists the
  46. error conditions that are possible for that function. Not all library
  47. functions use this mechanism; some return an error code directly,
  48. instead.
  49. @strong{Warning:} Many library functions may set @code{errno} to some
  50. meaningless non-zero value even if they did not encounter any errors,
  51. and even if they return error codes directly. Therefore, it is
  52. usually incorrect to check @emph{whether} an error occurred by
  53. inspecting the value of @code{errno}. The proper way to check for
  54. error is documented for each function.
  55. @strong{Portability Note:} @w{ISO C} specifies @code{errno} as a
  56. ``modifiable lvalue'' rather than as a variable, permitting it to be
  57. implemented as a macro. For example, its expansion might involve a
  58. function call, like @w{@code{*__errno_location ()}}. In fact, that is
  59. what it is
  60. on @gnulinuxhurdsystems{}. @Theglibc{}, on each system, does
  61. whatever is right for the particular system.
  62. There are a few library functions, like @code{sqrt} and @code{atan},
  63. that return a perfectly legitimate value in case of an error, but also
  64. set @code{errno}. For these functions, if you want to check to see
  65. whether an error occurred, the recommended method is to set @code{errno}
  66. to zero before calling the function, and then check its value afterward.
  67. @end deftypevr
  68. @pindex errno.h
  69. All the error codes have symbolic names; they are macros defined in
  70. @file{errno.h}. The names start with @samp{E} and an upper-case
  71. letter or digit; you should consider names of this form to be
  72. reserved names. @xref{Reserved Names}.
  73. The error code values are all positive integers and are all distinct,
  74. with one exception: @code{EWOULDBLOCK} and @code{EAGAIN} are the same.
  75. Since the values are distinct, you can use them as labels in a
  76. @code{switch} statement; just don't use both @code{EWOULDBLOCK} and
  77. @code{EAGAIN}. Your program should not make any other assumptions about
  78. the specific values of these symbolic constants.
  79. The value of @code{errno} doesn't necessarily have to correspond to any
  80. of these macros, since some library functions might return other error
  81. codes of their own for other situations. The only values that are
  82. guaranteed to be meaningful for a particular library function are the
  83. ones that this manual lists for that function.
  84. Except on @gnuhurdsystems{}, almost any system call can return @code{EFAULT} if
  85. it is given an invalid pointer as an argument. Since this could only
  86. happen as a result of a bug in your program, and since it will not
  87. happen on @gnuhurdsystems{}, we have saved space by not mentioning
  88. @code{EFAULT} in the descriptions of individual functions.
  89. In some Unix systems, many system calls can also return @code{EFAULT} if
  90. given as an argument a pointer into the stack, and the kernel for some
  91. obscure reason fails in its attempt to extend the stack. If this ever
  92. happens, you should probably try using statically or dynamically
  93. allocated memory instead of stack memory on that system.
  94. @node Error Codes, Error Messages, Checking for Errors, Error Reporting
  95. @section Error Codes
  96. @pindex errno.h
  97. The error code macros are defined in the header file @file{errno.h}.
  98. All of them expand into integer constant values. Some of these error
  99. codes can't occur on @gnusystems{}, but they can occur using @theglibc{}
  100. on other systems.
  101. @deftypevr Macro int EPERM
  102. @standards{POSIX.1, errno.h}
  103. @errno{EPERM, 1, Operation not permitted}
  104. Only the owner of the file (or other resource)
  105. or processes with special privileges can perform the operation.
  106. @end deftypevr
  107. @deftypevr Macro int ENOENT
  108. @standards{POSIX.1, errno.h}
  109. @errno{ENOENT, 2, No such file or directory}
  110. This is a ``file doesn't exist'' error
  111. for ordinary files that are referenced in contexts where they are
  112. expected to already exist.
  113. @end deftypevr
  114. @deftypevr Macro int ESRCH
  115. @standards{POSIX.1, errno.h}
  116. @errno{ESRCH, 3, No such process}
  117. No process matches the specified process ID.
  118. @end deftypevr
  119. @deftypevr Macro int EINTR
  120. @standards{POSIX.1, errno.h}
  121. @errno{EINTR, 4, Interrupted system call}
  122. An asynchronous signal occurred and prevented
  123. completion of the call. When this happens, you should try the call
  124. again.
  125. You can choose to have functions resume after a signal that is handled,
  126. rather than failing with @code{EINTR}; see @ref{Interrupted
  127. Primitives}.
  128. @end deftypevr
  129. @deftypevr Macro int EIO
  130. @standards{POSIX.1, errno.h}
  131. @errno{EIO, 5, Input/output error}
  132. Usually used for physical read or write errors.
  133. @end deftypevr
  134. @deftypevr Macro int ENXIO
  135. @standards{POSIX.1, errno.h}
  136. @errno{ENXIO, 6, No such device or address}
  137. The system tried to use the device
  138. represented by a file you specified, and it couldn't find the device.
  139. This can mean that the device file was installed incorrectly, or that
  140. the physical device is missing or not correctly attached to the
  141. computer.
  142. @end deftypevr
  143. @deftypevr Macro int E2BIG
  144. @standards{POSIX.1, errno.h}
  145. @errno{E2BIG, 7, Argument list too long}
  146. Used when the arguments passed to a new program
  147. being executed with one of the @code{exec} functions (@pxref{Executing a
  148. File}) occupy too much memory space. This condition never arises on
  149. @gnuhurdsystems{}.
  150. @end deftypevr
  151. @deftypevr Macro int ENOEXEC
  152. @standards{POSIX.1, errno.h}
  153. @errno{ENOEXEC, 8, Exec format error}
  154. Invalid executable file format. This condition is detected by the
  155. @code{exec} functions; see @ref{Executing a File}.
  156. @end deftypevr
  157. @deftypevr Macro int EBADF
  158. @standards{POSIX.1, errno.h}
  159. @errno{EBADF, 9, Bad file descriptor}
  160. For example, I/O on a descriptor that has been
  161. closed or reading from a descriptor open only for writing (or vice
  162. versa).
  163. @end deftypevr
  164. @deftypevr Macro int ECHILD
  165. @standards{POSIX.1, errno.h}
  166. @errno{ECHILD, 10, No child processes}
  167. This error happens on operations that are
  168. supposed to manipulate child processes, when there aren't any processes
  169. to manipulate.
  170. @end deftypevr
  171. @deftypevr Macro int EDEADLK
  172. @standards{POSIX.1, errno.h}
  173. @errno{EDEADLK, 11, Resource deadlock avoided}
  174. Allocating a system resource would have resulted in a
  175. deadlock situation. The system does not guarantee that it will notice
  176. all such situations. This error means you got lucky and the system
  177. noticed; it might just hang. @xref{File Locks}, for an example.
  178. @end deftypevr
  179. @deftypevr Macro int ENOMEM
  180. @standards{POSIX.1, errno.h}
  181. @errno{ENOMEM, 12, Cannot allocate memory}
  182. The system cannot allocate more virtual memory
  183. because its capacity is full.
  184. @end deftypevr
  185. @deftypevr Macro int EACCES
  186. @standards{POSIX.1, errno.h}
  187. @errno{EACCES, 13, Permission denied}
  188. The file permissions do not allow the attempted operation.
  189. @end deftypevr
  190. @deftypevr Macro int EFAULT
  191. @standards{POSIX.1, errno.h}
  192. @errno{EFAULT, 14, Bad address}
  193. An invalid pointer was detected.
  194. On @gnuhurdsystems{}, this error never happens; you get a signal instead.
  195. @end deftypevr
  196. @deftypevr Macro int ENOTBLK
  197. @standards{BSD, errno.h}
  198. @errno{ENOTBLK, 15, Block device required}
  199. A file that isn't a block special file was given in a situation that
  200. requires one. For example, trying to mount an ordinary file as a file
  201. system in Unix gives this error.
  202. @end deftypevr
  203. @deftypevr Macro int EBUSY
  204. @standards{POSIX.1, errno.h}
  205. @errno{EBUSY, 16, Device or resource busy}
  206. A system resource that can't be shared is already in use.
  207. For example, if you try to delete a file that is the root of a currently
  208. mounted filesystem, you get this error.
  209. @end deftypevr
  210. @deftypevr Macro int EEXIST
  211. @standards{POSIX.1, errno.h}
  212. @errno{EEXIST, 17, File exists}
  213. An existing file was specified in a context where it only
  214. makes sense to specify a new file.
  215. @end deftypevr
  216. @deftypevr Macro int EXDEV
  217. @standards{POSIX.1, errno.h}
  218. @errno{EXDEV, 18, Invalid cross-device link}
  219. An attempt to make an improper link across file systems was detected.
  220. This happens not only when you use @code{link} (@pxref{Hard Links}) but
  221. also when you rename a file with @code{rename} (@pxref{Renaming Files}).
  222. @end deftypevr
  223. @deftypevr Macro int ENODEV
  224. @standards{POSIX.1, errno.h}
  225. @errno{ENODEV, 19, No such device}
  226. The wrong type of device was given to a function that expects a
  227. particular sort of device.
  228. @end deftypevr
  229. @deftypevr Macro int ENOTDIR
  230. @standards{POSIX.1, errno.h}
  231. @errno{ENOTDIR, 20, Not a directory}
  232. A file that isn't a directory was specified when a directory is required.
  233. @end deftypevr
  234. @deftypevr Macro int EISDIR
  235. @standards{POSIX.1, errno.h}
  236. @errno{EISDIR, 21, Is a directory}
  237. You cannot open a directory for writing,
  238. or create or remove hard links to it.
  239. @end deftypevr
  240. @deftypevr Macro int EINVAL
  241. @standards{POSIX.1, errno.h}
  242. @errno{EINVAL, 22, Invalid argument}
  243. This is used to indicate various kinds of problems
  244. with passing the wrong argument to a library function.
  245. @end deftypevr
  246. @deftypevr Macro int EMFILE
  247. @standards{POSIX.1, errno.h}
  248. @errno{EMFILE, 24, Too many open files}
  249. The current process has too many files open and can't open any more.
  250. Duplicate descriptors do count toward this limit.
  251. In BSD and GNU, the number of open files is controlled by a resource
  252. limit that can usually be increased. If you get this error, you might
  253. want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
  254. @pxref{Limits on Resources}.
  255. @end deftypevr
  256. @deftypevr Macro int ENFILE
  257. @standards{POSIX.1, errno.h}
  258. @errno{ENFILE, 23, Too many open files in system}
  259. There are too many distinct file openings in the entire system. Note
  260. that any number of linked channels count as just one file opening; see
  261. @ref{Linked Channels}. This error never occurs on @gnuhurdsystems{}.
  262. @end deftypevr
  263. @deftypevr Macro int ENOTTY
  264. @standards{POSIX.1, errno.h}
  265. @errno{ENOTTY, 25, Inappropriate ioctl for device}
  266. Inappropriate I/O control operation, such as trying to set terminal
  267. modes on an ordinary file.
  268. @end deftypevr
  269. @deftypevr Macro int ETXTBSY
  270. @standards{BSD, errno.h}
  271. @errno{ETXTBSY, 26, Text file busy}
  272. An attempt to execute a file that is currently open for writing, or
  273. write to a file that is currently being executed. Often using a
  274. debugger to run a program is considered having it open for writing and
  275. will cause this error. (The name stands for ``text file busy''.) This
  276. is not an error on @gnuhurdsystems{}; the text is copied as necessary.
  277. @end deftypevr
  278. @deftypevr Macro int EFBIG
  279. @standards{POSIX.1, errno.h}
  280. @errno{EFBIG, 27, File too large}
  281. The size of a file would be larger than allowed by the system.
  282. @end deftypevr
  283. @deftypevr Macro int ENOSPC
  284. @standards{POSIX.1, errno.h}
  285. @errno{ENOSPC, 28, No space left on device}
  286. Write operation on a file failed because the
  287. disk is full.
  288. @end deftypevr
  289. @deftypevr Macro int ESPIPE
  290. @standards{POSIX.1, errno.h}
  291. @errno{ESPIPE, 29, Illegal seek}
  292. Invalid seek operation (such as on a pipe).
  293. @end deftypevr
  294. @deftypevr Macro int EROFS
  295. @standards{POSIX.1, errno.h}
  296. @errno{EROFS, 30, Read-only file system}
  297. An attempt was made to modify something on a read-only file system.
  298. @end deftypevr
  299. @deftypevr Macro int EMLINK
  300. @standards{POSIX.1, errno.h}
  301. @errno{EMLINK, 31, Too many links}
  302. The link count of a single file would become too large.
  303. @code{rename} can cause this error if the file being renamed already has
  304. as many links as it can take (@pxref{Renaming Files}).
  305. @end deftypevr
  306. @deftypevr Macro int EPIPE
  307. @standards{POSIX.1, errno.h}
  308. @errno{EPIPE, 32, Broken pipe}
  309. There is no process reading from the other end of a pipe.
  310. Every library function that returns this error code also generates a
  311. @code{SIGPIPE} signal; this signal terminates the program if not handled
  312. or blocked. Thus, your program will never actually see @code{EPIPE}
  313. unless it has handled or blocked @code{SIGPIPE}.
  314. @end deftypevr
  315. @deftypevr Macro int EDOM
  316. @standards{ISO, errno.h}
  317. @errno{EDOM, 33, Numerical argument out of domain}
  318. Used by mathematical functions when an argument value does
  319. not fall into the domain over which the function is defined.
  320. @end deftypevr
  321. @deftypevr Macro int ERANGE
  322. @standards{ISO, errno.h}
  323. @errno{ERANGE, 34, Numerical result out of range}
  324. Used by mathematical functions when the result value is
  325. not representable because of overflow or underflow.
  326. @end deftypevr
  327. @deftypevr Macro int EAGAIN
  328. @standards{POSIX.1, errno.h}
  329. @errno{EAGAIN, 35, Resource temporarily unavailable}
  330. The call might work if you try again
  331. later. The macro @code{EWOULDBLOCK} is another name for @code{EAGAIN};
  332. they are always the same in @theglibc{}.
  333. This error can happen in a few different situations:
  334. @itemize @bullet
  335. @item
  336. An operation that would block was attempted on an object that has
  337. non-blocking mode selected. Trying the same operation again will block
  338. until some external condition makes it possible to read, write, or
  339. connect (whatever the operation). You can use @code{select} to find out
  340. when the operation will be possible; @pxref{Waiting for I/O}.
  341. @strong{Portability Note:} In many older Unix systems, this condition
  342. was indicated by @code{EWOULDBLOCK}, which was a distinct error code
  343. different from @code{EAGAIN}. To make your program portable, you should
  344. check for both codes and treat them the same.
  345. @item
  346. A temporary resource shortage made an operation impossible. @code{fork}
  347. can return this error. It indicates that the shortage is expected to
  348. pass, so your program can try the call again later and it may succeed.
  349. It is probably a good idea to delay for a few seconds before trying it
  350. again, to allow time for other processes to release scarce resources.
  351. Such shortages are usually fairly serious and affect the whole system,
  352. so usually an interactive program should report the error to the user
  353. and return to its command loop.
  354. @end itemize
  355. @end deftypevr
  356. @deftypevr Macro int EWOULDBLOCK
  357. @standards{BSD, errno.h}
  358. @errno{EWOULDBLOCK, EAGAIN, Operation would block}
  359. In @theglibc{}, this is another name for @code{EAGAIN} (above).
  360. The values are always the same, on every operating system.
  361. C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
  362. separate error code.
  363. @end deftypevr
  364. @deftypevr Macro int EINPROGRESS
  365. @standards{BSD, errno.h}
  366. @errno{EINPROGRESS, 36, Operation now in progress}
  367. An operation that cannot complete immediately was initiated on an object
  368. that has non-blocking mode selected. Some functions that must always
  369. block (such as @code{connect}; @pxref{Connecting}) never return
  370. @code{EAGAIN}. Instead, they return @code{EINPROGRESS} to indicate that
  371. the operation has begun and will take some time. Attempts to manipulate
  372. the object before the call completes return @code{EALREADY}. You can
  373. use the @code{select} function to find out when the pending operation
  374. has completed; @pxref{Waiting for I/O}.
  375. @end deftypevr
  376. @deftypevr Macro int EALREADY
  377. @standards{BSD, errno.h}
  378. @errno{EALREADY, 37, Operation already in progress}
  379. An operation is already in progress on an object that has non-blocking
  380. mode selected.
  381. @end deftypevr
  382. @deftypevr Macro int ENOTSOCK
  383. @standards{BSD, errno.h}
  384. @errno{ENOTSOCK, 38, Socket operation on non-socket}
  385. A file that isn't a socket was specified when a socket is required.
  386. @end deftypevr
  387. @deftypevr Macro int EMSGSIZE
  388. @standards{BSD, errno.h}
  389. @errno{EMSGSIZE, 40, Message too long}
  390. The size of a message sent on a socket was larger than the supported
  391. maximum size.
  392. @end deftypevr
  393. @deftypevr Macro int EPROTOTYPE
  394. @standards{BSD, errno.h}
  395. @errno{EPROTOTYPE, 41, Protocol wrong type for socket}
  396. The socket type does not support the requested communications protocol.
  397. @end deftypevr
  398. @deftypevr Macro int ENOPROTOOPT
  399. @standards{BSD, errno.h}
  400. @errno{ENOPROTOOPT, 42, Protocol not available}
  401. You specified a socket option that doesn't make sense for the
  402. particular protocol being used by the socket. @xref{Socket Options}.
  403. @end deftypevr
  404. @deftypevr Macro int EPROTONOSUPPORT
  405. @standards{BSD, errno.h}
  406. @errno{EPROTONOSUPPORT, 43, Protocol not supported}
  407. The socket domain does not support the requested communications protocol
  408. (perhaps because the requested protocol is completely invalid).
  409. @xref{Creating a Socket}.
  410. @end deftypevr
  411. @deftypevr Macro int ESOCKTNOSUPPORT
  412. @standards{BSD, errno.h}
  413. @errno{ESOCKTNOSUPPORT, 44, Socket type not supported}
  414. The socket type is not supported.
  415. @end deftypevr
  416. @deftypevr Macro int EOPNOTSUPP
  417. @standards{BSD, errno.h}
  418. @errno{EOPNOTSUPP, 45, Operation not supported}
  419. The operation you requested is not supported. Some socket functions
  420. don't make sense for all types of sockets, and others may not be
  421. implemented for all communications protocols. On @gnuhurdsystems{}, this
  422. error can happen for many calls when the object does not support the
  423. particular operation; it is a generic indication that the server knows
  424. nothing to do for that call.
  425. @end deftypevr
  426. @deftypevr Macro int EPFNOSUPPORT
  427. @standards{BSD, errno.h}
  428. @errno{EPFNOSUPPORT, 46, Protocol family not supported}
  429. The socket communications protocol family you requested is not supported.
  430. @end deftypevr
  431. @deftypevr Macro int EAFNOSUPPORT
  432. @standards{BSD, errno.h}
  433. @errno{EAFNOSUPPORT, 47, Address family not supported by protocol}
  434. The address family specified for a socket is not supported; it is
  435. inconsistent with the protocol being used on the socket. @xref{Sockets}.
  436. @end deftypevr
  437. @deftypevr Macro int EADDRINUSE
  438. @standards{BSD, errno.h}
  439. @errno{EADDRINUSE, 48, Address already in use}
  440. The requested socket address is already in use. @xref{Socket Addresses}.
  441. @end deftypevr
  442. @deftypevr Macro int EADDRNOTAVAIL
  443. @standards{BSD, errno.h}
  444. @errno{EADDRNOTAVAIL, 49, Cannot assign requested address}
  445. The requested socket address is not available; for example, you tried
  446. to give a socket a name that doesn't match the local host name.
  447. @xref{Socket Addresses}.
  448. @end deftypevr
  449. @deftypevr Macro int ENETDOWN
  450. @standards{BSD, errno.h}
  451. @errno{ENETDOWN, 50, Network is down}
  452. A socket operation failed because the network was down.
  453. @end deftypevr
  454. @deftypevr Macro int ENETUNREACH
  455. @standards{BSD, errno.h}
  456. @errno{ENETUNREACH, 51, Network is unreachable}
  457. A socket operation failed because the subnet containing the remote host
  458. was unreachable.
  459. @end deftypevr
  460. @deftypevr Macro int ENETRESET
  461. @standards{BSD, errno.h}
  462. @errno{ENETRESET, 52, Network dropped connection on reset}
  463. A network connection was reset because the remote host crashed.
  464. @end deftypevr
  465. @deftypevr Macro int ECONNABORTED
  466. @standards{BSD, errno.h}
  467. @errno{ECONNABORTED, 53, Software caused connection abort}
  468. A network connection was aborted locally.
  469. @end deftypevr
  470. @deftypevr Macro int ECONNRESET
  471. @standards{BSD, errno.h}
  472. @errno{ECONNRESET, 54, Connection reset by peer}
  473. A network connection was closed for reasons outside the control of the
  474. local host, such as by the remote machine rebooting or an unrecoverable
  475. protocol violation.
  476. @end deftypevr
  477. @deftypevr Macro int ENOBUFS
  478. @standards{BSD, errno.h}
  479. @errno{ENOBUFS, 55, No buffer space available}
  480. The kernel's buffers for I/O operations are all in use. In GNU, this
  481. error is always synonymous with @code{ENOMEM}; you may get one or the
  482. other from network operations.
  483. @end deftypevr
  484. @deftypevr Macro int EISCONN
  485. @standards{BSD, errno.h}
  486. @errno{EISCONN, 56, Transport endpoint is already connected}
  487. You tried to connect a socket that is already connected.
  488. @xref{Connecting}.
  489. @end deftypevr
  490. @deftypevr Macro int ENOTCONN
  491. @standards{BSD, errno.h}
  492. @errno{ENOTCONN, 57, Transport endpoint is not connected}
  493. The socket is not connected to anything. You get this error when you
  494. try to transmit data over a socket, without first specifying a
  495. destination for the data. For a connectionless socket (for datagram
  496. protocols, such as UDP), you get @code{EDESTADDRREQ} instead.
  497. @end deftypevr
  498. @deftypevr Macro int EDESTADDRREQ
  499. @standards{BSD, errno.h}
  500. @errno{EDESTADDRREQ, 39, Destination address required}
  501. No default destination address was set for the socket. You get this
  502. error when you try to transmit data over a connectionless socket,
  503. without first specifying a destination for the data with @code{connect}.
  504. @end deftypevr
  505. @deftypevr Macro int ESHUTDOWN
  506. @standards{BSD, errno.h}
  507. @errno{ESHUTDOWN, 58, Cannot send after transport endpoint shutdown}
  508. The socket has already been shut down.
  509. @end deftypevr
  510. @deftypevr Macro int ETOOMANYREFS
  511. @standards{BSD, errno.h}
  512. @errno{ETOOMANYREFS, 59, Too many references: cannot splice}
  513. @end deftypevr
  514. @deftypevr Macro int ETIMEDOUT
  515. @standards{BSD, errno.h}
  516. @errno{ETIMEDOUT, 60, Connection timed out}
  517. A socket operation with a specified timeout received no response during
  518. the timeout period.
  519. @end deftypevr
  520. @deftypevr Macro int ECONNREFUSED
  521. @standards{BSD, errno.h}
  522. @errno{ECONNREFUSED, 61, Connection refused}
  523. A remote host refused to allow the network connection (typically because
  524. it is not running the requested service).
  525. @end deftypevr
  526. @deftypevr Macro int ELOOP
  527. @standards{BSD, errno.h}
  528. @errno{ELOOP, 62, Too many levels of symbolic links}
  529. Too many levels of symbolic links were encountered in looking up a file name.
  530. This often indicates a cycle of symbolic links.
  531. @end deftypevr
  532. @deftypevr Macro int ENAMETOOLONG
  533. @standards{POSIX.1, errno.h}
  534. @errno{ENAMETOOLONG, 63, File name too long}
  535. Filename too long (longer than @code{PATH_MAX}; @pxref{Limits for
  536. Files}) or host name too long (in @code{gethostname} or
  537. @code{sethostname}; @pxref{Host Identification}).
  538. @end deftypevr
  539. @deftypevr Macro int EHOSTDOWN
  540. @standards{BSD, errno.h}
  541. @errno{EHOSTDOWN, 64, Host is down}
  542. The remote host for a requested network connection is down.
  543. @end deftypevr
  544. @deftypevr Macro int EHOSTUNREACH
  545. @standards{BSD, errno.h}
  546. @errno{EHOSTUNREACH, 65, No route to host}
  547. The remote host for a requested network connection is not reachable.
  548. @end deftypevr
  549. @deftypevr Macro int ENOTEMPTY
  550. @standards{POSIX.1, errno.h}
  551. @errno{ENOTEMPTY, 66, Directory not empty}
  552. Directory not empty, where an empty directory was expected. Typically,
  553. this error occurs when you are trying to delete a directory.
  554. @end deftypevr
  555. @deftypevr Macro int EPROCLIM
  556. @standards{BSD, errno.h}
  557. @errno{EPROCLIM, 67, Too many processes}
  558. This means that the per-user limit on new process would be exceeded by
  559. an attempted @code{fork}. @xref{Limits on Resources}, for details on
  560. the @code{RLIMIT_NPROC} limit.
  561. @end deftypevr
  562. @deftypevr Macro int EUSERS
  563. @standards{BSD, errno.h}
  564. @errno{EUSERS, 68, Too many users}
  565. The file quota system is confused because there are too many users.
  566. @c This can probably happen in a GNU system when using NFS.
  567. @end deftypevr
  568. @deftypevr Macro int EDQUOT
  569. @standards{BSD, errno.h}
  570. @errno{EDQUOT, 69, Disk quota exceeded}
  571. The user's disk quota was exceeded.
  572. @end deftypevr
  573. @deftypevr Macro int ESTALE
  574. @standards{BSD, errno.h}
  575. @errno{ESTALE, 70, Stale file handle}
  576. This indicates an internal confusion in the
  577. file system which is due to file system rearrangements on the server host
  578. for NFS file systems or corruption in other file systems.
  579. Repairing this condition usually requires unmounting, possibly repairing
  580. and remounting the file system.
  581. @end deftypevr
  582. @deftypevr Macro int EREMOTE
  583. @standards{BSD, errno.h}
  584. @errno{EREMOTE, 71, Object is remote}
  585. An attempt was made to NFS-mount a remote file system with a file name that
  586. already specifies an NFS-mounted file.
  587. (This is an error on some operating systems, but we expect it to work
  588. properly on @gnuhurdsystems{}, making this error code impossible.)
  589. @end deftypevr
  590. @deftypevr Macro int EBADRPC
  591. @standards{BSD, errno.h}
  592. @errno{EBADRPC, 72, RPC struct is bad}
  593. @end deftypevr
  594. @deftypevr Macro int ERPCMISMATCH
  595. @standards{BSD, errno.h}
  596. @errno{ERPCMISMATCH, 73, RPC version wrong}
  597. @end deftypevr
  598. @deftypevr Macro int EPROGUNAVAIL
  599. @standards{BSD, errno.h}
  600. @errno{EPROGUNAVAIL, 74, RPC program not available}
  601. @end deftypevr
  602. @deftypevr Macro int EPROGMISMATCH
  603. @standards{BSD, errno.h}
  604. @errno{EPROGMISMATCH, 75, RPC program version wrong}
  605. @end deftypevr
  606. @deftypevr Macro int EPROCUNAVAIL
  607. @standards{BSD, errno.h}
  608. @errno{EPROCUNAVAIL, 76, RPC bad procedure for program}
  609. @end deftypevr
  610. @deftypevr Macro int ENOLCK
  611. @standards{POSIX.1, errno.h}
  612. @errno{ENOLCK, 77, No locks available}
  613. This is used by the file locking facilities; see
  614. @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
  615. it can result from an operation to an NFS server running another
  616. operating system.
  617. @end deftypevr
  618. @deftypevr Macro int EFTYPE
  619. @standards{BSD, errno.h}
  620. @errno{EFTYPE, 79, Inappropriate file type or format}
  621. The file was the wrong type for the
  622. operation, or a data file had the wrong format.
  623. On some systems @code{chmod} returns this error if you try to set the
  624. sticky bit on a non-directory file; @pxref{Setting Permissions}.
  625. @end deftypevr
  626. @deftypevr Macro int EAUTH
  627. @standards{BSD, errno.h}
  628. @errno{EAUTH, 80, Authentication error}
  629. @end deftypevr
  630. @deftypevr Macro int ENEEDAUTH
  631. @standards{BSD, errno.h}
  632. @errno{ENEEDAUTH, 81, Need authenticator}
  633. @end deftypevr
  634. @deftypevr Macro int ENOSYS
  635. @standards{POSIX.1, errno.h}
  636. @errno{ENOSYS, 78, Function not implemented}
  637. This indicates that the function called is
  638. not implemented at all, either in the C library itself or in the
  639. operating system. When you get this error, you can be sure that this
  640. particular function will always fail with @code{ENOSYS} unless you
  641. install a new version of the C library or the operating system.
  642. @end deftypevr
  643. @deftypevr Macro int ELIBEXEC
  644. @standards{GNU, errno.h}
  645. @errno{ELIBEXEC, 83, Cannot exec a shared library directly}
  646. @end deftypevr
  647. @deftypevr Macro int ENOTSUP
  648. @standards{POSIX.1, errno.h}
  649. @errno{ENOTSUP, 118, Not supported}
  650. A function returns this error when certain parameter
  651. values are valid, but the functionality they request is not available.
  652. This can mean that the function does not implement a particular command
  653. or option value or flag bit at all. For functions that operate on some
  654. object given in a parameter, such as a file descriptor or a port, it
  655. might instead mean that only @emph{that specific object} (file
  656. descriptor, port, etc.) is unable to support the other parameters given;
  657. different file descriptors might support different ranges of parameter
  658. values.
  659. If the entire function is not available at all in the implementation,
  660. it returns @code{ENOSYS} instead.
  661. @end deftypevr
  662. @deftypevr Macro int EILSEQ
  663. @standards{ISO, errno.h}
  664. @errno{EILSEQ, 106, Invalid or incomplete multibyte or wide character}
  665. While decoding a multibyte character the function came along an invalid
  666. or an incomplete sequence of bytes or the given wide character is invalid.
  667. @end deftypevr
  668. @deftypevr Macro int EBACKGROUND
  669. @standards{GNU, errno.h}
  670. @errno{EBACKGROUND, 100, Inappropriate operation for background process}
  671. On @gnuhurdsystems{}, servers supporting the @code{term} protocol return
  672. this error for certain operations when the caller is not in the
  673. foreground process group of the terminal. Users do not usually see this
  674. error because functions such as @code{read} and @code{write} translate
  675. it into a @code{SIGTTIN} or @code{SIGTTOU} signal. @xref{Job Control},
  676. for information on process groups and these signals.
  677. @end deftypevr
  678. @deftypevr Macro int EDIED
  679. @standards{GNU, errno.h}
  680. @errno{EDIED, 101, Translator died}
  681. On @gnuhurdsystems{}, opening a file returns this error when the file is
  682. translated by a program and the translator program dies while starting
  683. up, before it has connected to the file.
  684. @end deftypevr
  685. @deftypevr Macro int ED
  686. @standards{GNU, errno.h}
  687. @errno{ED, 102, ?}
  688. The experienced user will know what is wrong.
  689. @c This error code is a joke. Its perror text is part of the joke.
  690. @c Don't change it.
  691. @end deftypevr
  692. @deftypevr Macro int EGREGIOUS
  693. @standards{GNU, errno.h}
  694. @errno{EGREGIOUS, 103, You really blew it this time}
  695. You did @strong{what}?
  696. @end deftypevr
  697. @deftypevr Macro int EIEIO
  698. @standards{GNU, errno.h}
  699. @errno{EIEIO, 104, Computer bought the farm}
  700. Go home and have a glass of warm, dairy-fresh milk.
  701. @c Okay. Since you are dying to know, I'll tell you.
  702. @c This is a joke, obviously. There is a children's song which begins,
  703. @c "Old McDonald had a farm, e-i-e-i-o." Every time I see the (real)
  704. @c errno macro EIO, I think about that song. Probably most of my
  705. @c compatriots who program on Unix do, too. One of them must have stayed
  706. @c up a little too late one night and decided to add it to Hurd or Glibc.
  707. @c Whoever did it should be castigated, but it made me laugh.
  708. @c --jtobey@channel1.com
  709. @c
  710. @c "bought the farm" means "died". -jtobey
  711. @c
  712. @c Translators, please do not translate this litteraly, translate it into
  713. @c an idiomatic funny way of saying that the computer died.
  714. @end deftypevr
  715. @deftypevr Macro int EGRATUITOUS
  716. @standards{GNU, errno.h}
  717. @errno{EGRATUITOUS, 105, Gratuitous error}
  718. This error code has no purpose.
  719. @end deftypevr
  720. @deftypevr Macro int EBADMSG
  721. @standards{XOPEN, errno.h}
  722. @errno{EBADMSG, 107, Bad message}
  723. @end deftypevr
  724. @deftypevr Macro int EIDRM
  725. @standards{XOPEN, errno.h}
  726. @errno{EIDRM, 108, Identifier removed}
  727. @end deftypevr
  728. @deftypevr Macro int EMULTIHOP
  729. @standards{XOPEN, errno.h}
  730. @errno{EMULTIHOP, 109, Multihop attempted}
  731. @end deftypevr
  732. @deftypevr Macro int ENODATA
  733. @standards{XOPEN, errno.h}
  734. @errno{ENODATA, 110, No data available}
  735. @end deftypevr
  736. @deftypevr Macro int ENOLINK
  737. @standards{XOPEN, errno.h}
  738. @errno{ENOLINK, 111, Link has been severed}
  739. @end deftypevr
  740. @deftypevr Macro int ENOMSG
  741. @standards{XOPEN, errno.h}
  742. @errno{ENOMSG, 112, No message of desired type}
  743. @end deftypevr
  744. @deftypevr Macro int ENOSR
  745. @standards{XOPEN, errno.h}
  746. @errno{ENOSR, 113, Out of streams resources}
  747. @end deftypevr
  748. @deftypevr Macro int ENOSTR
  749. @standards{XOPEN, errno.h}
  750. @errno{ENOSTR, 114, Device not a stream}
  751. @end deftypevr
  752. @deftypevr Macro int EOVERFLOW
  753. @standards{XOPEN, errno.h}
  754. @errno{EOVERFLOW, 115, Value too large for defined data type}
  755. @end deftypevr
  756. @deftypevr Macro int EPROTO
  757. @standards{XOPEN, errno.h}
  758. @errno{EPROTO, 116, Protocol error}
  759. @end deftypevr
  760. @deftypevr Macro int ETIME
  761. @standards{XOPEN, errno.h}
  762. @errno{ETIME, 117, Timer expired}
  763. @end deftypevr
  764. @deftypevr Macro int ECANCELED
  765. @standards{POSIX.1, errno.h}
  766. @errno{ECANCELED, 119, Operation canceled}
  767. An asynchronous operation was canceled before it
  768. completed. @xref{Asynchronous I/O}. When you call @code{aio_cancel},
  769. the normal result is for the operations affected to complete with this
  770. error; @pxref{Cancel AIO Operations}.
  771. @end deftypevr
  772. @deftypevr Macro int EOWNERDEAD
  773. @standards{GNU, errno.h}
  774. @errno{EOWNERDEAD, 120, Owner died}
  775. @end deftypevr
  776. @deftypevr Macro int ENOTRECOVERABLE
  777. @standards{GNU, errno.h}
  778. @errno{ENOTRECOVERABLE, 121, State not recoverable}
  779. @end deftypevr
  780. @emph{The following error codes are defined by the Linux/i386 kernel.
  781. They are not yet documented.}
  782. @deftypevr Macro int ERESTART
  783. @standards{Linux???, errno.h}
  784. @errno{ERESTART, ???/85, Interrupted system call should be restarted}
  785. @end deftypevr
  786. @deftypevr Macro int ECHRNG
  787. @standards{Linux???, errno.h}
  788. @errno{ECHRNG, ???/44, Channel number out of range}
  789. @end deftypevr
  790. @deftypevr Macro int EL2NSYNC
  791. @standards{Obsolete, errno.h}
  792. @errno{EL2NSYNC, ???/45, Level 2 not synchronized}
  793. @end deftypevr
  794. @deftypevr Macro int EL3HLT
  795. @standards{Obsolete, errno.h}
  796. @errno{EL3HLT, ???/46, Level 3 halted}
  797. @end deftypevr
  798. @deftypevr Macro int EL3RST
  799. @standards{Obsolete, errno.h}
  800. @errno{EL3RST, ???/47, Level 3 reset}
  801. @end deftypevr
  802. @deftypevr Macro int ELNRNG
  803. @standards{Linux???, errno.h}
  804. @errno{ELNRNG, ???/48, Link number out of range}
  805. @end deftypevr
  806. @deftypevr Macro int EUNATCH
  807. @standards{Linux???, errno.h}
  808. @errno{EUNATCH, ???/49, Protocol driver not attached}
  809. @end deftypevr
  810. @deftypevr Macro int ENOCSI
  811. @standards{Linux???, errno.h}
  812. @errno{ENOCSI, ???/50, No CSI structure available}
  813. @end deftypevr
  814. @deftypevr Macro int EL2HLT
  815. @standards{Obsolete, errno.h}
  816. @errno{EL2HLT, ???/51, Level 2 halted}
  817. @end deftypevr
  818. @deftypevr Macro int EBADE
  819. @standards{Linux???, errno.h}
  820. @errno{EBADE, ???/52, Invalid exchange}
  821. @end deftypevr
  822. @deftypevr Macro int EBADR
  823. @standards{Linux???, errno.h}
  824. @errno{EBADR, ???/53, Invalid request descriptor}
  825. @end deftypevr
  826. @deftypevr Macro int EXFULL
  827. @standards{Linux???, errno.h}
  828. @errno{EXFULL, ???/54, Exchange full}
  829. @end deftypevr
  830. @deftypevr Macro int ENOANO
  831. @standards{Linux???, errno.h}
  832. @errno{ENOANO, ???/55, No anode}
  833. @end deftypevr
  834. @deftypevr Macro int EBADRQC
  835. @standards{Linux???, errno.h}
  836. @errno{EBADRQC, ???/56, Invalid request code}
  837. @end deftypevr
  838. @deftypevr Macro int EBADSLT
  839. @standards{Linux???, errno.h}
  840. @errno{EBADSLT, ???/57, Invalid slot}
  841. @end deftypevr
  842. @deftypevr Macro int EDEADLOCK
  843. @standards{Linux???, errno.h}
  844. @errno{EDEADLOCK, ???/58, File locking deadlock error}
  845. @end deftypevr
  846. @deftypevr Macro int EBFONT
  847. @standards{Linux???, errno.h}
  848. @errno{EBFONT, ???/59, Bad font file format}
  849. @end deftypevr
  850. @deftypevr Macro int ENONET
  851. @standards{Linux???, errno.h}
  852. @errno{ENONET, ???/64, Machine is not on the network}
  853. @end deftypevr
  854. @deftypevr Macro int ENOPKG
  855. @standards{Linux???, errno.h}
  856. @errno{ENOPKG, ???/65, Package not installed}
  857. @end deftypevr
  858. @deftypevr Macro int EADV
  859. @standards{Linux???, errno.h}
  860. @errno{EADV, ???/68, Advertise error}
  861. @end deftypevr
  862. @deftypevr Macro int ESRMNT
  863. @standards{Linux???, errno.h}
  864. @errno{ESRMNT, ???/69, Srmount error}
  865. @end deftypevr
  866. @deftypevr Macro int ECOMM
  867. @standards{Linux???, errno.h}
  868. @errno{ECOMM, ???/70, Communication error on send}
  869. @end deftypevr
  870. @deftypevr Macro int EDOTDOT
  871. @standards{Linux???, errno.h}
  872. @errno{EDOTDOT, ???/73, RFS specific error}
  873. @end deftypevr
  874. @deftypevr Macro int ENOTUNIQ
  875. @standards{Linux???, errno.h}
  876. @errno{ENOTUNIQ, ???/76, Name not unique on network}
  877. @end deftypevr
  878. @deftypevr Macro int EBADFD
  879. @standards{Linux???, errno.h}
  880. @errno{EBADFD, ???/77, File descriptor in bad state}
  881. @end deftypevr
  882. @deftypevr Macro int EREMCHG
  883. @standards{Linux???, errno.h}
  884. @errno{EREMCHG, ???/78, Remote address changed}
  885. @end deftypevr
  886. @deftypevr Macro int ELIBACC
  887. @standards{Linux???, errno.h}
  888. @errno{ELIBACC, ???/79, Can not access a needed shared library}
  889. @end deftypevr
  890. @deftypevr Macro int ELIBBAD
  891. @standards{Linux???, errno.h}
  892. @errno{ELIBBAD, ???/80, Accessing a corrupted shared library}
  893. @end deftypevr
  894. @deftypevr Macro int ELIBSCN
  895. @standards{Linux???, errno.h}
  896. @errno{ELIBSCN, ???/81, .lib section in a.out corrupted}
  897. @end deftypevr
  898. @deftypevr Macro int ELIBMAX
  899. @standards{Linux???, errno.h}
  900. @errno{ELIBMAX, ???/82, Attempting to link in too many shared libraries}
  901. @end deftypevr
  902. @deftypevr Macro int ESTRPIPE
  903. @standards{Linux???, errno.h}
  904. @errno{ESTRPIPE, ???/86, Streams pipe error}
  905. @end deftypevr
  906. @deftypevr Macro int EUCLEAN
  907. @standards{Linux???, errno.h}
  908. @errno{EUCLEAN, ???/117, Structure needs cleaning}
  909. @end deftypevr
  910. @deftypevr Macro int ENOTNAM
  911. @standards{Linux???, errno.h}
  912. @errno{ENOTNAM, ???/118, Not a XENIX named type file}
  913. @end deftypevr
  914. @deftypevr Macro int ENAVAIL
  915. @standards{Linux???, errno.h}
  916. @errno{ENAVAIL, ???/119, No XENIX semaphores available}
  917. @end deftypevr
  918. @deftypevr Macro int EISNAM
  919. @standards{Linux???, errno.h}
  920. @errno{EISNAM, ???/120, Is a named type file}
  921. @end deftypevr
  922. @deftypevr Macro int EREMOTEIO
  923. @standards{Linux???, errno.h}
  924. @errno{EREMOTEIO, ???/121, Remote I/O error}
  925. @end deftypevr
  926. @deftypevr Macro int ENOMEDIUM
  927. @standards{Linux???, errno.h}
  928. @errno{ENOMEDIUM, ???/???, No medium found}
  929. @end deftypevr
  930. @deftypevr Macro int EMEDIUMTYPE
  931. @standards{Linux???, errno.h}
  932. @errno{EMEDIUMTYPE, ???/???, Wrong medium type}
  933. @end deftypevr
  934. @deftypevr Macro int ENOKEY
  935. @standards{Linux, errno.h}
  936. @errno{ENOKEY, ???/???, Required key not available}
  937. @end deftypevr
  938. @deftypevr Macro int EKEYEXPIRED
  939. @standards{Linux, errno.h}
  940. @errno{EKEYEXPIRED, ???/???, Key has expired}
  941. @end deftypevr
  942. @deftypevr Macro int EKEYREVOKED
  943. @standards{Linux, errno.h}
  944. @errno{EKEYREVOKED, ???/???, Key has been revoked}
  945. @end deftypevr
  946. @deftypevr Macro int EKEYREJECTED
  947. @standards{Linux, errno.h}
  948. @errno{EKEYREJECTED, ???/???, Key was rejected by service}
  949. @end deftypevr
  950. @deftypevr Macro int ERFKILL
  951. @standards{Linux, errno.h}
  952. @errno{ERFKILL, ???/???, Operation not possible due to RF-kill}
  953. @end deftypevr
  954. @deftypevr Macro int EHWPOISON
  955. @standards{Linux, errno.h}
  956. @errno{EHWPOISON, ???/???, Memory page has hardware error}
  957. @end deftypevr
  958. @node Error Messages, , Error Codes, Error Reporting
  959. @section Error Messages
  960. The library has functions and variables designed to make it easy for
  961. your program to report informative error messages in the customary
  962. format about the failure of a library call. The functions
  963. @code{strerror} and @code{perror} give you the standard error message
  964. for a given error code; the variable
  965. @w{@code{program_invocation_short_name}} gives you convenient access to the
  966. name of the program that encountered the error.
  967. @deftypefun {char *} strerror (int @var{errnum})
  968. @standards{ISO, string.h}
  969. @safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @ascuintl{}}@acunsafe{@acsmem{}}}
  970. The @code{strerror} function maps the error code (@pxref{Checking for
  971. Errors}) specified by the @var{errnum} argument to a descriptive error
  972. message string. The string is translated according to the current
  973. locale. The return value is a pointer to this string.
  974. The value @var{errnum} normally comes from the variable @code{errno}.
  975. You should not modify the string returned by @code{strerror}. Also, if
  976. you make subsequent calls to @code{strerror} or @code{strerror_l}, or
  977. the thread that obtained the string exits, the returned pointer will be
  978. invalidated.
  979. As there is no way to restore the previous state after calling
  980. @code{strerror}, library code should not call this function because it
  981. may interfere with application use of @code{strerror}, invalidating the
  982. string pointer before the application is done using it. Instead,
  983. @code{strerror_r}, @code{snprintf} with the @samp{%m} or @samp{%#m}
  984. specifiers, @code{strerrorname_np}, or @code{strerrordesc_np} can be
  985. used instead.
  986. The @code{strerror} function preserves the value of @code{errno} and
  987. cannot fail.
  988. The function @code{strerror} is declared in @file{string.h}.
  989. @end deftypefun
  990. @deftypefun {char *} strerror_l (int @var{errnum}, locale_t @var{locale})
  991. @standards{POSIX, string.h}
  992. @safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @ascuintl{}}@acunsafe{@acsmem{}}}
  993. This function is like @code{strerror}, except that the returned string
  994. is translated according to @var{locale} (instead of the current locale
  995. used by @code{strerror}). Note that calling @code{strerror_l}
  996. invalidates the pointer returned by @code{strerror} and vice versa.
  997. The function @code{strerror_l} is defined by POSIX and is declared in
  998. @file{string.h}.
  999. @end deftypefun
  1000. @deftypefun {char *} strerror_r (int @var{errnum}, char *@var{buf}, size_t @var{n})
  1001. @standards{GNU, string.h}
  1002. @safety{@prelim{}@mtsafe{}@asunsafe{@ascuintl{}}@acunsafe{}}
  1003. The following description is for the GNU variant of the function,
  1004. used if @code{_GNU_SOURCE} is defined. @xref{Feature Test Macros}.
  1005. The @code{strerror_r} function works like @code{strerror} but instead of
  1006. returning a pointer to a string that is managed by @theglibc{}, it can
  1007. use the user supplied buffer starting at @var{buf} for storing the
  1008. string.
  1009. At most @var{n} characters are written (including the NUL byte) to
  1010. @var{buf}, so it is up to the user to select a buffer large enough.
  1011. Whether returned pointer points to the @var{buf} array or not depends on
  1012. the @var{errnum} argument. If the result string is not stored in
  1013. @var{buf}, the string will not change for the remaining execution
  1014. of the program.
  1015. The function @code{strerror_r} as described above is a GNU extension and
  1016. it is declared in @file{string.h}. There is a POSIX variant of this
  1017. function, described next.
  1018. @end deftypefun
  1019. @deftypefun int strerror_r (int @var{errnum}, char *@var{buf}, size_t @var{n})
  1020. @standards{POSIX, string.h}
  1021. @safety{@prelim{}@mtsafe{}@asunsafe{@ascuintl{}}@acunsafe{}}
  1022. This variant of the @code{strerror_r} function is used if a standard is
  1023. selected that includes @code{strerror_r}, but @code{_GNU_SOURCE} is not
  1024. defined. This POSIX variant of the function always writes the error
  1025. message to the specified buffer @var{buf} of size @var{n} bytes.
  1026. Upon success, @code{strerror_r} returns 0. Two more return values are
  1027. used to indicate failure.
  1028. @vtable @code
  1029. @item EINVAL
  1030. The @var{errnum} argument does not correspond to a known error constant.
  1031. @item ERANGE
  1032. The buffer size @var{n} is not large enough to store the entire error message.
  1033. @end vtable
  1034. Even if an error is reported, @code{strerror_r} still writes as much of
  1035. the error message to the output buffer as possible. After a call to
  1036. @code{strerror_r}, the value of @code{errno} is unspecified.
  1037. If you want to use the always-copying POSIX semantics of
  1038. @code{strerror_r} in a program that is potentially compiled with
  1039. @code{_GNU_SOURCE} defined, you can use @code{snprintf} with the
  1040. @samp{%m} conversion specifier, like this:
  1041. @smallexample
  1042. int saved_errno = errno;
  1043. errno = errnum;
  1044. int ret = snprintf (buf, n, "%m");
  1045. errno = saved_errno;
  1046. if (strerrorname_np (errnum) == NULL)
  1047. return EINVAL;
  1048. if (ret >= n)
  1049. return ERANGE:
  1050. return 0;
  1051. @end smallexample
  1052. This function is declared in @file{string.h} if it is declared at all.
  1053. It is a POSIX extension.
  1054. @end deftypefun
  1055. @deftypefun void perror (const char *@var{message})
  1056. @standards{ISO, stdio.h}
  1057. @safety{@prelim{}@mtunsafe{@mtasurace{:stderr}}@asunsafe{@asucorrupt{} @ascuintl{} @ascuheap{} @asulock{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{} @acsfd{}}}
  1058. @c Besides strerror_r's and some of fprintf's issues, if stderr is not
  1059. @c oriented yet, create a new stream with a dup of stderr's fd and write
  1060. @c to that instead of stderr, to avoid orienting it.
  1061. This function prints an error message to the stream @code{stderr};
  1062. see @ref{Standard Streams}. The orientation of @code{stderr} is not
  1063. changed.
  1064. If you call @code{perror} with a @var{message} that is either a null
  1065. pointer or an empty string, @code{perror} just prints the error message
  1066. corresponding to @code{errno}, adding a trailing newline.
  1067. If you supply a non-null @var{message} argument, then @code{perror}
  1068. prefixes its output with this string. It adds a colon and a space
  1069. character to separate the @var{message} from the error string corresponding
  1070. to @code{errno}.
  1071. The function @code{perror} is declared in @file{stdio.h}.
  1072. @end deftypefun
  1073. @deftypefun {const char *} strerrorname_np (int @var{errnum})
  1074. @standards{GNU, string.h}
  1075. @safety{@mtsafe{}@assafe{}@acsafe{}}
  1076. This function returns the name describing the error @var{errnum} or
  1077. @code{NULL} if there is no known constant with this value (e.g "EINVAL"
  1078. for @code{EINVAL}). The returned string does not change for the
  1079. remaining execution of the program.
  1080. @pindex string.h
  1081. This function is a GNU extension, declared in the header file @file{string.h}.
  1082. @end deftypefun
  1083. @deftypefun {const char *} strerrordesc_np (int @var{errnum})
  1084. @standards{GNU, string.h}
  1085. @safety{@mtsafe{}@assafe{}@acsafe{}}
  1086. This function returns the message describing the error @var{errnum} or
  1087. @code{NULL} if there is no known constant with this value (e.g "Invalid
  1088. argument" for @code{EINVAL}). Different than @code{strerror} the
  1089. returned description is not translated, and the returned string does not
  1090. change for the remaining execution of the program.
  1091. @pindex string.h
  1092. This function is a GNU extension, declared in the header file @file{string.h}.
  1093. @end deftypefun
  1094. @code{strerror} and @code{perror} produce the exact same message for any
  1095. given error code under the same locale; the precise text varies from
  1096. system to system. With @theglibc{}, the messages are fairly short;
  1097. there are no multi-line messages or embedded newlines. Each error
  1098. message begins with a capital letter and does not include any
  1099. terminating punctuation.
  1100. @cindex program name
  1101. @cindex name of running program
  1102. Many programs that don't read input from the terminal are designed to
  1103. exit if any system call fails. By convention, the error message from
  1104. such a program should start with the program's name, sans directories.
  1105. You can find that name in the variable
  1106. @code{program_invocation_short_name}; the full file name is stored the
  1107. variable @code{program_invocation_name}.
  1108. @deftypevar {char *} program_invocation_name
  1109. @standards{GNU, errno.h}
  1110. This variable's value is the name that was used to invoke the program
  1111. running in the current process. It is the same as @code{argv[0]}. Note
  1112. that this is not necessarily a useful file name; often it contains no
  1113. directory names. @xref{Program Arguments}.
  1114. This variable is a GNU extension and is declared in @file{errno.h}.
  1115. @end deftypevar
  1116. @deftypevar {char *} program_invocation_short_name
  1117. @standards{GNU, errno.h}
  1118. This variable's value is the name that was used to invoke the program
  1119. running in the current process, with directory names removed. (That is
  1120. to say, it is the same as @code{program_invocation_name} minus
  1121. everything up to the last slash, if any.)
  1122. This variable is a GNU extension and is declared in @file{errno.h}.
  1123. @end deftypevar
  1124. The library initialization code sets up both of these variables before
  1125. calling @code{main}.
  1126. @strong{Portability Note:} If you want your program to work with
  1127. non-GNU libraries, you must save the value of @code{argv[0]} in
  1128. @code{main}, and then strip off the directory names yourself. We
  1129. added these extensions to make it possible to write self-contained
  1130. error-reporting subroutines that require no explicit cooperation from
  1131. @code{main}.
  1132. Here is an example showing how to handle failure to open a file
  1133. correctly. The function @code{open_sesame} tries to open the named file
  1134. for reading and returns a stream if successful. The @code{fopen}
  1135. library function returns a null pointer if it couldn't open the file for
  1136. some reason. In that situation, @code{open_sesame} constructs an
  1137. appropriate error message using the @code{strerror} function, and
  1138. terminates the program. If we were going to make some other library
  1139. calls before passing the error code to @code{strerror}, we'd have to
  1140. save it in a local variable instead, because those other library
  1141. functions might overwrite @code{errno} in the meantime.
  1142. @smallexample
  1143. #define _GNU_SOURCE
  1144. #include <errno.h>
  1145. #include <stdio.h>
  1146. #include <stdlib.h>
  1147. #include <string.h>
  1148. FILE *
  1149. open_sesame (char *name)
  1150. @{
  1151. FILE *stream;
  1152. errno = 0;
  1153. stream = fopen (name, "r");
  1154. if (stream == NULL)
  1155. @{
  1156. fprintf (stderr, "%s: Couldn't open file %s; %s\n",
  1157. program_invocation_short_name, name, strerror (errno));
  1158. exit (EXIT_FAILURE);
  1159. @}
  1160. else
  1161. return stream;
  1162. @}
  1163. @end smallexample
  1164. Using @code{perror} has the advantage that the function is portable and
  1165. available on all systems implementing @w{ISO C}. But often the text
  1166. @code{perror} generates is not what is wanted and there is no way to
  1167. extend or change what @code{perror} does. The GNU coding standard, for
  1168. instance, requires error messages to be preceded by the program name and
  1169. programs which read some input files should provide information
  1170. about the input file name and the line number in case an error is
  1171. encountered while reading the file. For these occasions there are two
  1172. functions available which are widely used throughout the GNU project.
  1173. These functions are declared in @file{error.h}.
  1174. @deftypefun void error (int @var{status}, int @var{errnum}, const char *@var{format}, @dots{})
  1175. @standards{GNU, error.h}
  1176. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @asuheap{} @asuintl{}}@acsafe{}}
  1177. @c Cancellation is disabled throughout the execution. It flushes stdout
  1178. @c and then holds a lock on stderr while printing the program name and
  1179. @c then running error_tail. The non-wide case just runs vfprintf; the
  1180. @c wide case converts the message to an alloca/malloc-allocated buffer
  1181. @c with mbsrtowcs, then prints it with vfwprintf. Afterwards,
  1182. @c print_errno_message calls strerror_r and fxprintf.
  1183. The @code{error} function can be used to report general problems during
  1184. program execution. The @var{format} argument is a format string just
  1185. like those given to the @code{printf} family of functions. The
  1186. arguments required for the format can follow the @var{format} parameter.
  1187. Just like @code{perror}, @code{error} also can report an error code in
  1188. textual form. But unlike @code{perror} the error value is explicitly
  1189. passed to the function in the @var{errnum} parameter. This eliminates
  1190. the problem mentioned above that the error reporting function must be
  1191. called immediately after the function causing the error since otherwise
  1192. @code{errno} might have a different value.
  1193. @code{error} prints first the program name. If the application
  1194. defined a global variable @code{error_print_progname} and points it to a
  1195. function this function will be called to print the program name.
  1196. Otherwise the string from the global variable @code{program_name} is
  1197. used. The program name is followed by a colon and a space which in turn
  1198. is followed by the output produced by the format string. If the
  1199. @var{errnum} parameter is non-zero the format string output is followed
  1200. by a colon and a space, followed by the error message for the error code
  1201. @var{errnum}. In any case is the output terminated with a newline.
  1202. The output is directed to the @code{stderr} stream. If the
  1203. @code{stderr} wasn't oriented before the call it will be narrow-oriented
  1204. afterwards.
  1205. The function will return unless the @var{status} parameter has a
  1206. non-zero value. In this case the function will call @code{exit} with
  1207. the @var{status} value for its parameter and therefore never return. If
  1208. @code{error} returns, the global variable @code{error_message_count} is
  1209. incremented by one to keep track of the number of errors reported.
  1210. @end deftypefun
  1211. @deftypefun void error_at_line (int @var{status}, int @var{errnum}, const char *@var{fname}, unsigned int @var{lineno}, const char *@var{format}, @dots{})
  1212. @standards{GNU, error.h}
  1213. @safety{@prelim{}@mtunsafe{@mtasurace{:error_at_line/error_one_per_line} @mtslocale{}}@asunsafe{@asucorrupt{} @asuheap{} @asuintl{}}@acunsafe{@acucorrupt{/error_one_per_line}}}
  1214. @c The error_one_per_line variable is accessed (without any form of
  1215. @c synchronization, but since it's an int used once, it should be safe
  1216. @c enough) and, if this mode is enabled, static variables used to hold
  1217. @c the last printed file name and line number are accessed and modified
  1218. @c without synchronization; the update is not atomic and it occurs
  1219. @c before disabling cancellation, so it can be interrupted after only
  1220. @c one of the two variables is modified. After that, it's very much
  1221. @c like error.
  1222. The @code{error_at_line} function is very similar to the @code{error}
  1223. function. The only differences are the additional parameters @var{fname}
  1224. and @var{lineno}. The handling of the other parameters is identical to
  1225. that of @code{error} except that between the program name and the string
  1226. generated by the format string additional text is inserted.
  1227. Directly following the program name a colon, followed by the file name
  1228. pointed to by @var{fname}, another colon, and the value of @var{lineno} is
  1229. printed.
  1230. This additional output of course is meant to be used to locate an error
  1231. in an input file (like a programming language source code file etc).
  1232. If the global variable @code{error_one_per_line} is set to a non-zero
  1233. value @code{error_at_line} will avoid printing consecutive messages for
  1234. the same file and line. Repetition which are not directly following
  1235. each other are not caught.
  1236. Just like @code{error} this function only returns if @var{status} is
  1237. zero. Otherwise @code{exit} is called with the non-zero value. If
  1238. @code{error} returns, the global variable @code{error_message_count} is
  1239. incremented by one to keep track of the number of errors reported.
  1240. @end deftypefun
  1241. As mentioned above, the @code{error} and @code{error_at_line} functions
  1242. can be customized by defining a variable named
  1243. @code{error_print_progname}.
  1244. @vindex error_print_progname
  1245. @deftypevar {void (*error_print_progname)} (void)
  1246. @standards{GNU, error.h}
  1247. If the @code{error_print_progname} variable is defined to a non-zero
  1248. value the function pointed to is called by @code{error} or
  1249. @code{error_at_line}. It is expected to print the program name or do
  1250. something similarly useful.
  1251. The function is expected to print to the @code{stderr} stream and
  1252. must be able to handle whatever orientation the stream has.
  1253. The variable is global and shared by all threads.
  1254. @end deftypevar
  1255. @deftypevar {unsigned int} error_message_count
  1256. @standards{GNU, error.h}
  1257. The @code{error_message_count} variable is incremented whenever one of
  1258. the functions @code{error} or @code{error_at_line} returns. The
  1259. variable is global and shared by all threads.
  1260. @end deftypevar
  1261. @deftypevar int error_one_per_line
  1262. @standards{GNU, error.h}
  1263. The @code{error_one_per_line} variable influences only
  1264. @code{error_at_line}. Normally the @code{error_at_line} function
  1265. creates output for every invocation. If @code{error_one_per_line} is
  1266. set to a non-zero value @code{error_at_line} keeps track of the last
  1267. file name and line number for which an error was reported and avoids
  1268. directly following messages for the same file and line. This variable
  1269. is global and shared by all threads.
  1270. @end deftypevar
  1271. @noindent
  1272. A program which read some input file and reports errors in it could look
  1273. like this:
  1274. @smallexample
  1275. @{
  1276. char *line = NULL;
  1277. size_t len = 0;
  1278. unsigned int lineno = 0;
  1279. error_message_count = 0;
  1280. while (! feof_unlocked (fp))
  1281. @{
  1282. ssize_t n = getline (&line, &len, fp);
  1283. if (n <= 0)
  1284. /* @r{End of file or error.} */
  1285. break;
  1286. ++lineno;
  1287. /* @r{Process the line.} */
  1288. @dots{}
  1289. if (@r{Detect error in line})
  1290. error_at_line (0, errval, filename, lineno,
  1291. "some error text %s", some_variable);
  1292. @}
  1293. if (error_message_count != 0)
  1294. error (EXIT_FAILURE, 0, "%u errors found", error_message_count);
  1295. @}
  1296. @end smallexample
  1297. @code{error} and @code{error_at_line} are clearly the functions of
  1298. choice and enable the programmer to write applications which follow the
  1299. GNU coding standard. @Theglibc{} additionally contains functions which
  1300. are used in BSD for the same purpose. These functions are declared in
  1301. @file{err.h}. It is generally advised to not use these functions. They
  1302. are included only for compatibility.
  1303. @deftypefun void warn (const char *@var{format}, @dots{})
  1304. @standards{BSD, err.h}
  1305. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascuintl{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1306. @c Just calls vwarn with the va_list.
  1307. The @code{warn} function is roughly equivalent to a call like
  1308. @smallexample
  1309. error (0, errno, format, @r{the parameters})
  1310. @end smallexample
  1311. @noindent
  1312. except that the global variables @code{error} respects and modifies
  1313. are not used.
  1314. @end deftypefun
  1315. @deftypefun void vwarn (const char *@var{format}, va_list @var{ap})
  1316. @standards{BSD, err.h}
  1317. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascuintl{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1318. @c While holding stderr's recursive lock, it prints the programname, the
  1319. @c given message, and the error string with fw?printf's %m. When the
  1320. @c stream is wide, convert_and_print converts the format string to an
  1321. @c alloca/malloc-created buffer using mbsrtowcs and then calls fwprintf.
  1322. The @code{vwarn} function is just like @code{warn} except that the
  1323. parameters for the handling of the format string @var{format} are passed
  1324. in as a value of type @code{va_list}.
  1325. @end deftypefun
  1326. @deftypefun void warnx (const char *@var{format}, @dots{})
  1327. @standards{BSD, err.h}
  1328. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1329. @c Same as warn, but without the strerror translation issues.
  1330. The @code{warnx} function is roughly equivalent to a call like
  1331. @smallexample
  1332. error (0, 0, format, @r{the parameters})
  1333. @end smallexample
  1334. @noindent
  1335. except that the global variables @code{error} respects and modifies
  1336. are not used. The difference to @code{warn} is that no error number
  1337. string is printed.
  1338. @end deftypefun
  1339. @deftypefun void vwarnx (const char *@var{format}, va_list @var{ap})
  1340. @standards{BSD, err.h}
  1341. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1342. @c Same as vwarn, but without the strerror translation issues.
  1343. The @code{vwarnx} function is just like @code{warnx} except that the
  1344. parameters for the handling of the format string @var{format} are passed
  1345. in as a value of type @code{va_list}.
  1346. @end deftypefun
  1347. @deftypefun void err (int @var{status}, const char *@var{format}, @dots{})
  1348. @standards{BSD, err.h}
  1349. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascuintl{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1350. @c Same as warn followed by exit.
  1351. The @code{err} function is roughly equivalent to a call like
  1352. @smallexample
  1353. error (status, errno, format, @r{the parameters})
  1354. @end smallexample
  1355. @noindent
  1356. except that the global variables @code{error} respects and modifies
  1357. are not used and that the program is exited even if @var{status} is zero.
  1358. @end deftypefun
  1359. @deftypefun void verr (int @var{status}, const char *@var{format}, va_list @var{ap})
  1360. @standards{BSD, err.h}
  1361. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{} @ascuintl{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1362. @c Same as vwarn followed by exit.
  1363. The @code{verr} function is just like @code{err} except that the
  1364. parameters for the handling of the format string @var{format} are passed
  1365. in as a value of type @code{va_list}.
  1366. @end deftypefun
  1367. @deftypefun void errx (int @var{status}, const char *@var{format}, @dots{})
  1368. @standards{BSD, err.h}
  1369. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1370. @c Same as warnx followed by exit.
  1371. The @code{errx} function is roughly equivalent to a call like
  1372. @smallexample
  1373. error (status, 0, format, @r{the parameters})
  1374. @end smallexample
  1375. @noindent
  1376. except that the global variables @code{error} respects and modifies
  1377. are not used and that the program is exited even if @var{status}
  1378. is zero. The difference to @code{err} is that no error number
  1379. string is printed.
  1380. @end deftypefun
  1381. @deftypefun void verrx (int @var{status}, const char *@var{format}, va_list @var{ap})
  1382. @standards{BSD, err.h}
  1383. @safety{@prelim{}@mtsafe{@mtslocale{}}@asunsafe{@asucorrupt{} @ascuheap{}}@acunsafe{@acucorrupt{} @aculock{} @acsmem{}}}
  1384. @c Same as vwarnx followed by exit.
  1385. The @code{verrx} function is just like @code{errx} except that the
  1386. parameters for the handling of the format string @var{format} are passed
  1387. in as a value of type @code{va_list}.
  1388. @end deftypefun