Errno is an integer variable defined in errnoh that is set b

Errno is an integer variable, defined in errno.h, that is set by system calls and some library functions in the event of an error to indicate what went wrong. There are symbolic error names with distinct values that are defined on Linux. Each of which corresponds to a type of error. The string description of any of these error names can be retrieved by strerror defined in string.h. For example, the error name \"ENFILE\" has the string description \"Too many open files in system\", and \"ENOEXEC\" has the string description \"Exec format error\", and so. In addition, perror defined in stdio.h prints the description of a system error on the standard error device preceded by any string that you provide and colons. Answer the following questions using a table format. What are the error names and descriptions of the fork system call. List all error names and descriptions specifically related to file I/O.

Solution

Find the answer below:

========================================================================

fork system call errors:

EAGAIN: Resorce temporarily unavailable. A system-imposed limit on the number of threads was encountered.

ENOMEM fork(): failed to allocate the necessary kernel structures because memory is tight.

ENOMEM: An attempt was made to create a child process in a PID namespace whose \"init\" process has                 terminated.

ENOSYS fork(): It is not supported on this platform (for example,hardware without a Memory-Management Unit).

ERESTARTNOINTR: System call was interrupted by a signal and will be restarted. (This can be seen only during                                 a trace.)

File I/O errors:

EBADF:           Bad file descriptor
EBADFD:         File descriptor in bad state
EEXIST:           File exists
EFBIG:             File too large
EISNAM:          Is a named type file
EMFILE:           Too many open files commonly caused by exceeding the RLIMIT_NOFILE resource limit.
ENAMETOOLONG:    Filename too long
ENFILE:          Too many open files in system on Linux,this is probably a result of encountering the limit
ENOENT:         No such file or directory ,Typically this error results when a specified pathname does not exist, or    one of the components in the directory prefix of a pathname does not exist, or the specified              pathname is a dangling symbolic link.
EROFS:           Read-only filesystem
ESTALE:          Stale file handle
ETXTBSY:        Text file busy

 Errno is an integer variable, defined in errno.h, that is set by system calls and some library functions in the event of an error to indicate what went wrong.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site