Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fd(4) [osx 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. FILES
/dev/fd/# /dev/stdin /dev/stdout /dev/stderr SEE ALSO
tty(4) 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

Um, this is lacking sense

Hello, and good day I'm somewhat confused with the workings of the Linux operating system, more specifically RedHat 7.1. The story began a few weeks ago when I downloaded SuSe 7.2, but failed at installation, then Caldera 2.4, then 3.1. Finally I landed upon RedHat 7.1--a fabulous... (6 Replies)
Discussion started by: jdandordalton
6 Replies

2. UNIX for Dummies Questions & Answers

cp multiple files to fd0

Hello all. I want to copy multiple files to a floppy. My distr. version is Mandrake 8.0. If i use , all is ok and the file is copied to disk If i use , I receive an error stating that /dev/fd0 is not a directory. I understand that /dev/fd0 is not a directory. Is there a way to... (7 Replies)
Discussion started by: wavy_lay
7 Replies

3. Programming

i want to pass the connect fd to child process,how can i do ti?

i write a function using to pass the socket connected fd to child process in the sco unix open server 5.0.5,but in fact i execute the program calling the fuction,system report send the fd error: Jul 12 12:15 send_fd.c: send_fd sendmsg to sd error how can i solve the problem ,please help me!!!... (6 Replies)
Discussion started by: hit
6 Replies

4. UNIX for Advanced & Expert Users

FD0 error code 30

Hi I am new to this forum. Iam facing very strange problem in sco open server 5. when i try to mount the fd0 it just says "fd0 writeprotected, read only error code 30" I changed the floppy drive. even I check the /dev/fd0 permissions it is read and wirte. I changed the floppies also. but... (6 Replies)
Discussion started by: Pritpal singh
6 Replies

5. Programming

the problem of gettimeofday

Hi all, I just wrote a small problem to check gettimeofday in a multi-cores environment. int timediff(double fTimeQvs, double fTimeTcp) { int iTimeDiff; iTimeDiff = (((((int)fTimeQvs)/10000) - (((int)fTimeTcp)/10000)) * 3600) * 1000000; iTimeDiff +=... (17 Replies)
Discussion started by: dophine
17 Replies

6. Linux

DSL Cfdisk error

I'm trying to instal dsl to hd ,but cfdisk comand returns an error. dmesg | grep hda returns : Optarac DVD RW AD-7530B, ATAPI CD/DVD-rom drive attached ide-scsi driver So i figure that is the problem.Right? What should i do? (9 Replies)
Discussion started by: SNAk55
9 Replies

7. UNIX for Dummies Questions & Answers

Ext3 to NTFS - transfering data

Alright so here is my problem: I have an ext3 external hard drive with about 270gb of data that needs to be copied/transferred to a NTFS drive. The NTFS drive has data currently on it...which obviously needs to stay intact. My supervisor mentioned that this problem could be a little tricky so I... (9 Replies)
Discussion started by: huntreilly25
9 Replies

8. Shell Programming and Scripting

Closing open file descriptors from /proc/pid/fd

Hi guys, i need to write a shell script that will close file descriptors from /proc/pid/fd will calling exec 4<&- solve the problem ? thanks in advance :) (15 Replies)
Discussion started by: alpha_romeo
15 Replies

9. Programming

Now i can't get FD_ISSET to work

I have this server I am making but it ignores an if statement which I have posted below so i want to ask If I could post main.c which compiles without errors for me and see if anyone could tell me why the code below doesn't trigger my function. I want to ask first because some forums don't... (7 Replies)
Discussion started by: Errigour
7 Replies

10. Shell Programming and Scripting

Use of awk/sed to filter out fdisk output

Hi , I am trying to filter out the below output of fdisk -l command : fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 ... (9 Replies)
Discussion started by: omkar.jadhav
9 Replies

11. Red Hat

Make a disk disappear from fdisk output

Hello, 1 ) Fdisk -l # Displays all the disk with partition table information My Query ) A ) How can i make one disk ex: /dev/sdd not visible in fdisk -l output ? B) From where fdisk -l collect and display the information ? (8 Replies)
Discussion started by: saurabh84g
8 Replies

12. SCO

"Unexpected EOF within #IF, #ifdef or #ifndef" error when rebuilding / relinking SCO OpenServer 5

Hi, I am a new Unix Guru with very little experience but have the task of P2Ving an old HP Proliant ML370 G5 server to VMware ESX 4.1 or ESXi 5.5. System seems to boots fine but when trying to remove HP software, configure TCP/IP or a driver, I am receiving: -------- ... (7 Replies)
Discussion started by: dj_Italian
7 Replies

13. Shell Programming and Scripting

Unix fdisk -l Automation

Hello Folks - Need help really ASAP. Iam trying to run this Shell command to get all the lists of partitions and disks from across all the servers. #!/bin/ksh _servers="" _out="/tmp/output.$$" _ssh=/usr/bin/ssh >$_out for s in $_servers do $_ssh $s fdisk -l >> $_out done ... (8 Replies)
Discussion started by: bkilaru
8 Replies

14. Shell Programming and Scripting

Fdisk and grep command not working in udev trigger

Hi Guys, Can someone take a look at my scripts what missing, plugin usb drive the script is running can log all my echo but cannot execute command. Is there any configuration in linux or to my scripts need to add?. What i want to achieve is every time I plugin the usbdisk automatic mount to... (21 Replies)
Discussion started by: lxdorney
21 Replies

15. Programming

C fdopen with and without -ansi

I have very little experience with gcc compilation under different environments, so please bear with me. I carried over 20 years old project into Ubuntu 18.04, it has old style K&R parameters, no function declarations to speak of, many functions without return are not declared void, and on and... (8 Replies)
Discussion started by: migurus
8 Replies