Courseiva
Essential Tools →easyMultiple Select

EX200 Essential Tools Practice Question

Which THREE file descriptors are always available for every Unix process?

⚠ Common exam trap

Red Hat often tests the misconception that file descriptors beyond 0, 1, and 2 are standard or always available, leading candidates to select options like '3: log file' or '4: socket' as if they were universally present.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

2: stderr

File descriptor 2 (stderr) is one of the three standard file descriptors that every Unix process inherits from its parent process. These descriptors are opened automatically by the kernel when a process starts, providing default channels for input (stdin, fd 0), output (stdout, fd 1), and error output (stderr, fd 2).

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    4: socket

    Why it's wrong here

    File descriptor 4 is not a standard, always-available descriptor in a POSIX process. A socket descriptor only exists after the application explicitly calls socket(), bind(), or accept(), and even then the kernel returns the lowest currently unused fd — often 4 if 0-3 are in use, but this is by no means guaranteed. At process creation, the only descriptors guaranteed open are 0, 1, and 2; any other descriptor, including a socket, is absent until explicitly created.

  • ✗

    3: log file

    Why it's wrong here

    A 'log file' descriptor is not pre-opened; no operating system automatically maps a fixed fd number to a log file. To write to a log, a process must call open() with the appropriate path and flags (e.g., O_WRONLY|O_CREAT), which then assigns the lowest free descriptor, often 3 but possibly another number. There is no standard, universal log file descriptor, and fd 3 is just as likely to be a regular file, pipe, or terminal as anything else.

  • ✓

    2: stderr

    Why this is correct

    stderr, file descriptor 2, is one of the three standard streams that the kernel guarantees to be open for every process from the moment it starts. It is specifically designated for error and diagnostic output, and is intentionally unbuffered or line-buffered so messages appear immediately, even if stdout is redirected or fully buffered. This descriptor is inherited from the parent process and can be redirected via shell operators like 2>.

  • ✓

    1: stdout

    Why this is correct

    stdout, file descriptor 1, is the standard output stream that is always open for normal, non-error data produced by a program. Like stdin and stderr, it is inherited from the parent process and is part of the default file descriptor table of every process. It is typically line-buffered when connected to a terminal, and can be redirected to a file or pipeline with shell operators such as > or |.

  • ✓

    0: stdin

    Why this is correct

    stdin, file descriptor 0, is the standard input stream that is always available for reading data, commonly from the keyboard or from a redirected file/pipe. It is the first descriptor in the process file descriptor table and is guaranteed to be open for every POSIX process at startup. Without this stream, a process could never accept interactive input or pipeline data, making fd 0 a foundational part of process I/O.

About these practice questions

This EX200 question is part of Courseiva's 427-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.