errno Info

Steve Jardine sjardine at acm.org
Thu Feb 14 09:33:41 PST 2008


Thank you sir.. That is exactly what I am looking for!

Steve

On Thu, 14 Feb 2008 06:50:10 -0600
vu pham <vu at sivell.com> wrote:

> Steve Jardine wrote:
> > All,
> > 
> >    I am using popen in some C code. It may set errno if it fails.If so, where can I find the value information? 
> > For instance, say the directory does not exist? Or the file does not exist?
> > 
> >     I know there is a header file I am too blind to find...
> > 
> 
> You can start from errno.h, which leads to this one for file operations' 
> error codes. ( there are some other files referred by errno.h but they 
> are not for file operations, I think ).
> ------------------------------------------------------
> /usr/include/asm-generic/errno-base.h ( on FC8)
> 
> #ifndef _ASM_GENERIC_ERRNO_BASE_H
> #define _ASM_GENERIC_ERRNO_BASE_H
> 
> #define EPERM            1      /* Operation not permitted */
> #define ENOENT           2      /* No such file or directory */
> #define ESRCH            3      /* No such process */
> #define EINTR            4      /* Interrupted system call */
> #define EIO              5      /* I/O error */
> #define ENXIO            6      /* No such device or address */
> #define E2BIG            7      /* Argument list too long */
> #define ENOEXEC          8      /* Exec format error */
> #define EBADF            9      /* Bad file number */
> #define ECHILD          10      /* No child processes */
> #define EAGAIN          11      /* Try again */
> #define ENOMEM          12      /* Out of memory */
> #define EACCES          13      /* Permission denied */
> #define EFAULT          14      /* Bad address */
> #define ENOTBLK         15      /* Block device required */
> #define EBUSY           16      /* Device or resource busy */
> #define EEXIST          17      /* File exists */
> #define EXDEV           18      /* Cross-device link */
> #define ENODEV          19      /* No such device */
> #define ENOTDIR         20      /* Not a directory */
> #define EISDIR          21      /* Is a directory */
> #define EINVAL          22      /* Invalid argument */
> #define ENFILE          23      /* File table overflow */
> #define EMFILE          24      /* Too many open files */
> #define ENOTTY          25      /* Not a typewriter */
> #define ETXTBSY         26      /* Text file busy */
> #define EFBIG           27      /* File too large */
> #define ENOSPC          28      /* No space left on device */
> #define ESPIPE          29      /* Illegal seek */
> #define EROFS           30      /* Read-only file system */
> #define EMLINK          31      /* Too many links */
> #define EPIPE           32      /* Broken pipe */
> #define EDOM            33      /* Math argument out of domain of func */
> #define ERANGE          34      /* Math result not representable */
> 
> #endif
> ~ 
>  
> 
> ~ 
> 
> ----------------------------------------------------------------------
> 
> 
> Vu
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc: 
> http://linux-sxs.org/mailman/listinfo/linux-users
> 
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
> 


-- 
"There is a clear attempt to establish truth not by scientific methods but by 
perpetual repetition."
- Richard S. Lindzen, Ph.D. Professor of Meteorology, MIT

"Show me just what Mohammed brought that was new, and there you will find things only evil and inhuman, such as his command to spread by the sword the faith he preached."
-- Pope Benedict XVI quoting Byzantine Emperor Emperor Michael Paleologos II

"...Davy Crokett had to shoot Santa Anna's men - but he sure would not get the mexicans vote" - Ted Nugent discussing why some politicians are reluctant to force illegal aliens out of the United States

Persuing liberty, free markets, and individualism.



More information about the Linux-users mailing list