Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stderr(4) [freebsd man page]

FD(4)							   BSD Kernel Interfaces Manual 						     FD(4)

NAME
fd, stdin, stdout, stderr -- file descriptor files DESCRIPTION
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call: fd = open("/dev/fd/0", mode); and the call: fd = fcntl(0, F_DUPFD, 0); are equivalent. Opening the files /dev/stdin, /dev/stdout and /dev/stderr is equivalent to the following calls: fd = fcntl(STDIN_FILENO, F_DUPFD, 0); fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); fd = fcntl(STDERR_FILENO, F_DUPFD, 0); Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored. IMPLEMENTATION NOTES
By default, /dev/fd is provided by devfs(5), which provides nodes for the first three file descriptors. Some sites may require nodes for additional file descriptors; these can be made available by mounting fdescfs(5) on /dev/fd. FILES
/dev/fd/# /dev/stdin /dev/stdout /dev/stderr SEE ALSO
tty(4), devfs(5), fdescfs(5) BSD
June 9, 1993 BSD

Check Out this Related Man Page

FD(4)							   BSD Kernel Interfaces Manual 						     FD(4)

NAME
fd, stdin, stdout, stderr -- file descriptor files DESCRIPTION
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call: fd = open("/dev/fd/0", mode); and the call: fd = fcntl(0, F_DUPFD, 0); are equivalent. Opening the files /dev/stdin, /dev/stdout and /dev/stderr is equivalent to the following calls: fd = fcntl(STDIN_FILENO, F_DUPFD, 0); fd = fcntl(STDOUT_FILENO, F_DUPFD, 0); fd = fcntl(STDERR_FILENO, F_DUPFD, 0); Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored. IMPLEMENTATION NOTES
By default, /dev/fd is provided by devfs(5), which provides nodes for the first three file descriptors. Some sites may require nodes for additional file descriptors; these can be made available by mounting fdescfs(5) on /dev/fd. FILES
/dev/fd/# /dev/stdin /dev/stdout /dev/stderr SEE ALSO
tty(4), devfs(5), fdescfs(5) BSD
June 9, 1993 BSD
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i-nodes

first off, i am new to unix so please bear with me. i was reading somewhere that if your i-nodes get critical that it can slow your network down. what are i-nodes and when do they become a critical number? this is what mine states: / (/dev/root ): 777058 blocks 569290 i-nodes... (4 Replies)
Discussion started by: djatwork
4 Replies

2. Programming

stderr

in fprint(stderr, "lkjalsdi\n"); what does stderr mean? thanks (1 Reply)
Discussion started by: dell9
1 Replies

3. UNIX for Dummies Questions & Answers

Opening files

I am very new to unix. I want to open a file and read one line in at a time. Can anybody help? (3 Replies)
Discussion started by: saarshad001
3 Replies

4. UNIX for Dummies Questions & Answers

Cannot open "/dev/tty"

Hi, When it proccesing the backup with cpio report this message: Cannot open "/dev/tty" and cancel de backup. Cuando se procesa la tarea del backup reporta el error: Cannot open "/dev/tty" y cancela el backup y no termina correctamente, a que se devera esta advertencia. Gracias. Thacks.... (3 Replies)
Discussion started by: cmr88
3 Replies

5. UNIX for Dummies Questions & Answers

Opening Files in append mode

Is there any other way to open a file in append mode without using C calls or >> redirection? (1 Reply)
Discussion started by: vidhya
1 Replies

6. UNIX for Dummies Questions & Answers

stdout back to tty

Hi everyone! Well, this is the thing.. I sent a process's stdout to /dev/null. This process is very time consuming and after a week it keeps running, what I need is to switch the stdout back to screen to see what's going on. Anyone know if it's possible and how to do it? Thanks and... (3 Replies)
Discussion started by: piltrafa
3 Replies

7. UNIX for Advanced & Expert Users

/dev/NULL can't open this file ??

when i write the following two statements : cp /dev/NULL /clocal/mqbrkrs/user/mqsiadm/sanjay/dspmq_temp cat /dev/NULL > /clocal/mqbrkrs/user/mqsiadm/sanjay/dspmq_temp its gives me errors like : cp: /dev/NULL: A file or directory in the path name does not exist. cat : /dev/NULL can't open... (2 Replies)
Discussion started by: varungupta
2 Replies

8. Programming

Access()System call

Hi, Is it possible to check the Existence/read/write of stdin,stdout,stderr using access() call like for the files we do. Ex: fd=access("./hi.txt",F_OK) Similarly I wanna check stdin/tdout/stderr using access() call I tried using fd=access(stdout,F_OK); But the result is -1. I... (3 Replies)
Discussion started by: ramkrix
3 Replies

9. Programming

C++ How to use pipe() & fork() with stdin and stdout to another program

Hi, Program A: uses pipe() I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using: * child -> dup2(fd, STDOUT_FILENO); -> execl("/path/PROGRAM B", "PROGRAM B", NULL); * parent -> char line; -> read(fd, line, 100); Question:... (2 Replies)
Discussion started by: vvaidyan
2 Replies

10. Shell Programming and Scripting

Confused with redirection and file descriptors

Hi all, I've been looking for the way to send stdout and stderr to different files. Well, actually I really knew how to make it, but I wanted to be sure. I've found an instruction very interesting which I'm not able to understand: taken from this site. It says it sends stdout to output.log,... (4 Replies)
Discussion started by: AlbertGM
4 Replies

11. AIX

STDIN Devie File Name and Location

Hi all, I want to know the device filename of STDIN in AIX. On other platforms(Linux and solaris), the device file for stdin is available at /dev/ directory as "/dev/stdin". But i didn't find any filename for STDIN at /dev/ directory in AIX. Please let me know the name and location of device... (3 Replies)
Discussion started by: erra_krishna
3 Replies

12. Shell Programming and Scripting

stdout/stderr to mail if error

I have searched the forum and seems like I just don't quite find my question. I have a script that runs out of cron and I am trying to send normal successful stdout to /dev/null, but if there is an error, I want both stdout/stderr to go to mail. In other words, I only want to know... (2 Replies)
Discussion started by: niswonp
2 Replies

13. Shell Programming and Scripting

Redirecting stdout continously to a file

I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is... (3 Replies)
Discussion started by: igurov
3 Replies

14. Shell Programming and Scripting

File descriptors, redirecting output, and stdout

Hello all. I've been lurking here for a year or two and finally decided to post. I need some assistance with file descriptors, stdout, and redirecting output. I've searched through a number of very helpful threads here (unfortunately I can't link to any of them yet due to my low post count...),... (2 Replies)
Discussion started by: Michael_K
2 Replies

15. Shell Programming and Scripting

Lost redirecting stderr & stdout to 3 files - one each plus combined

Hi folks I need/want to redirect output (stdout, stderr) from an exec call to separate files. One for stderr only and two(!) different (!) ones for the combined output of stderr and stdout. After some research and testing i got this so far : (( exec ${command} ${command_parameters} 3>&1... (6 Replies)
Discussion started by: MDominok
6 Replies