File:  [Plan 9 NeXT] / lucent / sys / man / 3 / dup
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:01:01 2018 UTC (8 years, 1 month ago) by root
Branches: lucent, MAIN
CVS tags: plan9, HEAD
Plan 9 NeXT

.TH DUP 3 
.SH NAME
dup \- dups of open files
.SH SYNOPSIS
.nf
.B bind #d /fd

.B /fd/0
.B /fd/1
\&...
.fi
.SH DESCRIPTION
The
.I dup
device serves a one-level directory containing files whose
names are decimal numbers.
A file of name
.I n
corresponds to open file descriptor
.I n
in the current process.
.PP
An
.IR open (2)
of file
.I n
results in a file descriptor identical to
what would be returned from a system call
.IB dup ( n ", -1)."
Note that the result is no longer a file in the
.I dup
device.
.PP
The
.I stat
operation returns information about the device file, not the open file it points to.
A stat of
.BI #d/ n
will contain
.I n
for the name, 0 for the length, and 0400, 0200, or 0600
for the mode, depending on whether the dup target is open
for reading, writing, or both.
.SH SEE ALSO
.IR dup (2)
.SH SOURCE
.B /sys/src/9/port/devdup.c

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.