Professional Documents
Culture Documents
Unix and Posix Apis
Unix and Posix Apis
Unix and Posix Apis
When APIs is invoked by a process, the execution context of the process is switched by the kernel from a usermode to a kernel mode. A usermode is the normal execution context of any user process and it allows the process to access its process specific data only. A kernel mode is protective execution environment that allows a user process to access kernel!s data in a restricted manner. When the API execution completes the user process is switched back to the user mode. "his context switching for each API call ensures that process access kernel!s data in a controlled manner and minimi#es any chance of a run away user application may damage entire system.
POSIX. , POSIX. & and U!IX "PIs o&'ect code is stored in li&c.a and li&c.so li&raries
ERROR STAT)S CO*E $$ %&A'I'( EACCESS ++ No access to &erfor( an o&eration !ia a API EPERM ++ a API "as a orted ecause the callin' &rocess does not ha!e su&eruser &ri!ile'e ENOENT ++ an in!alid filena(e "as s&ecified to an API ,A*++ a API "as called "ith an in!alid file descri&tor EINTR ++ a API execution "as a orted due to si'nal interru&tion
EAGAIN
++ a API "as a orted ecause s.ste( resource it re/uested "as te(&oraril. una!aila le ENOMEM ++ a API "as a orted ecause it could not allocate d.na(ic (e(or. EIO ++ I0O error occurred in a API excecution EPIPE ++ a API atte(&ted to "rite to a &i&e "hich has no reader
E-A)1T ar'u(ents
ENOE2EC ++ a API could not execute a &ro'ra( !ia one of the exec API ECHI1* child ++ a &rocess doesnot ha!e an. &rocess "hich it can "ait on