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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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).
/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.
Contains files for all open file descriptors of the process. Each entry is a decimal number corresponding to an open file descriptor in the process. If an entity refers to a regular file, it can be opened with normal file semantics. To ensure that the controlling process cannot gain greater access, there are no file access modes other than its own read/write open modes in the controlled process. Directories will be displayed as links. An attempt to open any other type of entry will fail (hence it will display 0 permission when listed).
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.