~ chicken-core (master) /manual/Module (chicken errno)
Trap1[[tags: manual]]2[[toc:]]34== Module (chicken errno)56This module provides access to the standard C {{errno}} value.78Be careful, if you're using threads, {{errno}} might be clobbered as9soon as another thread calls a C function. To prevent this from10happening, you can add {{(declare (disable-interrupts))}} at the top11of your file, or use the {{-disable-interrupts}} compiler option to12avoid any context switches while a procedure in this file is running.1314=== errno1516<procedure>(errno)</procedure>1718Returns the error code of the last system call.1920=== errno constants2122<constant>errno/perm</constant><br>23<constant>errno/noent</constant><br>24<constant>errno/srch</constant><br>25<constant>errno/intr</constant><br>26<constant>errno/io</constant><br>27<constant>errno/nxio</constant><br>28<constant>errno/2big</constant><br>29<constant>errno/noexec</constant><br>30<constant>errno/badf</constant><br>31<constant>errno/child</constant><br>32<constant>errno/again</constant><br>33<constant>errno/nomem</constant><br>34<constant>errno/acces</constant><br>35<constant>errno/fault</constant><br>36<constant>errno/busy</constant><br>37<constant>errno/exist</constant><br>38<constant>errno/xdev</constant><br>39<constant>errno/nodev</constant><br>40<constant>errno/notdir</constant><br>41<constant>errno/isdir</constant><br>42<constant>errno/inval</constant><br>43<constant>errno/nfile</constant><br>44<constant>errno/mfile</constant><br>45<constant>errno/notty</constant><br>46<constant>errno/fbig</constant><br>47<constant>errno/nospc</constant><br>48<constant>errno/spipe</constant><br>49<constant>errno/rofs</constant><br>50<constant>errno/mlink</constant><br>51<constant>errno/pipe</constant><br>52<constant>errno/dom</constant><br>53<constant>errno/range</constant><br>54<constant>errno/deadlk</constant><br>55<constant>errno/nametoolong</constant><br>56<constant>errno/nolck</constant><br>57<constant>errno/nosys</constant><br>58<constant>errno/notempty</constant><br>59<constant>errno/ilseq</constant><br>60<constant>errno/wouldblock</constant><br>6162These variables contain error codes as returned by {{errno}}.6364''NOTE'': On Windows, {{EWOULDBLOCK}} does not exist. For65consistency, {{errno/wouldblock}} does exist, but it is defined as66zero.6768This does mean that in case there is no error, it looks like the69{{errno/wouldblock}} error is returned. But you have to check the70return code of a system call before accessing {{errno}} anyway, so71this should typically never happen.7273---74Previous: [[Module (chicken csi)]]7576Next: [[Module (chicken eval)]]