In my Linux environment, the file descriptors are located on /dev/fd.

Where is the location of stdin, stdout, stderr file descriptor in AIX(unix).

I couldn't find them.


The question is based on a misconception about the generality of proc filesystems. Systems which implement this (such as Solaris and Linux) have special devices which may be used for scripting, including /dev/fd followed by a file descriptor (number).

With Solaris, /dev/fd is a virtual folder under /dev, while Linux uses a symbolic link to /proc into a (virtual) folder matching your process id. There are no standards for proc filesystems, and details will differ.

Checking AIX 5.3 and 7.1 systems, they do implement a proc filesystem, but have no /dev/fd. However, they do have a virtual filesystem /proc, under which you can find your current process-id, and under that is an fd folder with file descriptors.

Conventionally, file descriptors are initialized 0, 1, 2 for stdin, stdout, stderr respectively.

Further reading:

| improve this answer | |

Those are artificial file descriptors and are certainly not needed for processing, which explains that they were not there historically and still absent on some systems.

The shell handles these standard file descriptors based on your TTY. When the shell is started, it calls isatty(), and if it is (a TTY) it opens the standard file descriptors on it automatically.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.