?? intro.2
字號:
.TH INTRO 2 .de en.HP\\$1 \\$2 \\$3.br...SH NAMEintro, errno \- introduction to system calls and error numbers.SH SYNOPSIS.B #include <errno.h>.SH DESCRIPTIONSection 2 of this manuallists all the entries into the system.Most of these calls have an error return..pgAn error condition is indicated by an otherwiseimpossible returned value.Almost always this is \(mi1;the individual sections specify the details.An error number is also made availablein the external variable.IR errno ..I Errnois not cleared on successful calls, so it should be tested onlyafter an error has occurred..PPThere is a table of messagesassociated with each error, and a routine for printing themessage;See.IR perror (3).The possible error numbersare not recited with each writeup in section 2, since manyerrors are possible for most of the calls.Here is a list of the error numbers,their names as defined in <errno.h>,and the messages available using.IR perror ..en 0 \h'\w'EIO'u' "Error 0Unused..en 1 EPERM "Not ownerTypically this error indicatesan attempt to modify a file in some way forbiddenexcept to its owner or super-user.It is also returned for attemptsby ordinary users to do thingsallowed only to the super-user..en 2 ENOENT "No such file or directoryThis error occurs when a file name is specifiedand the file should exist but doesn't, or when oneof the directories in a path name does not exist..en 3 ESRCH "No such processThe process whose number was given to.I signaland.I ptracedoes not exist, or is already dead..en 4 EINTR "Interrupted system callAn asynchronous signal (such as interrupt or quit),which the user has elected to catch,occurred during a system call.If execution is resumedafter processing the signal,it will appear as if the interrupted system callreturned this error condition..en 5 EIO "I/O errorSome physical I/O error occurred during a.I reador.IR write .This error may in some cases occuron a call following the one to which it actually applies..en 6 ENXIO "No such device or addressI/O on a special file refers to a subdevice that does notexist,or beyond the limits of the device.It may also occur when, for example, a tape driveis not dialled in or no disk pack is loaded on a drive..en 7 E2BIG "Arg list too longAn argument list longer than 5120 bytesis presented to.IR exec ..en 8 ENOEXEC "Exec format errorA request is made to execute a filewhich, although it has the appropriate permissions,does not start with a valid magic number, see.IR a.out (5)..en 9 EBADF "Bad file numberEither a file descriptor refers to noopen file,or a read (resp. write) request is made toa file that is open only for writing (resp. reading)..en 10 ECHILD "No children.I Waitand the process has noliving or unwaited-for children..en 11 EAGAIN "No more processesIn a.I fork,the system's process table is fullor the user is not allowed to create any moreprocesses..en 12 ENOMEM "Not enough coreDuring an.I execor.I break,a program asks for more core than the system is able to supply.This is not a temporary condition; the maximum core sizeis a system parameter.The error may also occur if the arrangementof text, data, and stack segmentsrequires too many segmentation registers..en 13 EACCES "Permission deniedAn attempt was made to access a file in a way forbiddenby the protection system..en 14 EFAULT "Bad addressThe system encountered a hardware fault in attempting toaccess the arguments of a system call..en 15 ENOTBLK "Block device requiredA plain file was mentioned where a block device was required,e.g. in.IR mount ..en 16 EBUSY "Mount device busyAn attempt to mount a device that was already mounted oran attempt was made to dismount a deviceon which there is an active file(open file, current directory, mounted-on file, active text segment)..en 17 EEXIST "File existsAn existing file was mentioned in an inappropriate context,e.g..IR link ..en 18 EXDEV "Cross-device linkA link to a file on another devicewas attempted..en 19 ENODEV "No such deviceAn attempt was made to apply an inappropriatesystem call to a device;e.g. read a write-only device..en 20 ENOTDIR "Not a directoryA non-directory was specified where a directoryis required,for example in a path name oras an argument to.IR chdir ..en 21 EISDIR "Is a directoryAn attempt to write on a directory..en 22 EINVAL "Invalid argumentSome invalid argument:dismounting a non-mounteddevice,mentioning an unknown signal in.I signal,reading or writing a file for which.I seekhas generated a negative pointer.Also set by math functions, see .IR intro (3)..en 23 ENFILE "File table overflowThe system's table of open files is full,and temporarily no more.I openscan be accepted..en 24 EMFILE "Too many open filesCustomary configuration limit is 20 per process..en 25 ENOTTY "Not a typewriterThe file mentioned in.I sttyor.I gttyis not a terminal or one of the otherdevices to which these calls apply..en 26 ETXTBSY "Text file busyAn attempt to execute a pure-procedureprogram that is currently open for writing(or reading!).Also an attempt to open for writing a pure-procedureprogram that is being executed..en 27 EFBIG "File too largeThe size of a file exceeded the maximum (about.if t 10\u\s-29\s+2\d.if n 1.0E9bytes)..en 28 ENOSPC "No space left on deviceDuring a.I writeto an ordinary file,there is no free space left on the device..en 29 ESPIPE "Illegal seekAn.I lseekwas issued to a pipe.This error should also be issued forother non-seekable devices..en 30 EROFS "Read-only file systemAn attempt to modify a file or directorywas madeon a device mounted read-only..en 31 EMLINK "Too many linksAn attempt to make more than 32767 links to a file..en 32 EPIPE "Broken pipeA write on a pipe for which there is no processto read the data.This condition normally generates a signal;the error is returned if the signal is ignored..en 33 EDOM "Math argumentThe argument of a function in the math package (3M)is out of the domain of the function..en 34 ERANGE "Result too largeThe value of a function in the math package (3M)is unrepresentable within machine precision..SH SEE ALSOintro(3).SH ASSEMBLER.B as /usr/include/sys.s file ....PPThe PDP11 assembly language interface is given for eachsystem call.The assembler symbols are defined in `/usr/include/sys.s'..PPReturn values appear in registers r0 and r1;it is unwise to count on these registers being preservedwhen no value is expected.An erroneous call is alwaysindicated by turning on the c-bit of the condition codes.The error number is returned in r0.The presence of an error is most easily testedby the instructions.I besand.I bec(`branch on error set (or clear)').These are synonyms forthe.I bcsand.I bccinstructions..PPOn the Interdata 8/32, the system call argumentscorrespond well to the arguments of the C routines.The sequence is:.IP.nfla %2,errnol %0,&callnosvc 0,args.fi.PPThus register 2 points to a word into which the error number will bestored as needed; it is cleared if no error occurs.Register 0 contains the system call number; the nomenclatureis identical to that on the PDP11.The argument of the.I svcis the address of the arguments, laid out in storageas in the C calling sequence.The return value is in register 2 (possibly 3 also, as in.IR pipe )and is \-1 in case of error.The overflow bit in the program status word is alsoset when errors occur.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -