diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/inferno/man3/dup.3 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/inferno/man3/dup.3')
| -rw-r--r-- | static/inferno/man3/dup.3 | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/static/inferno/man3/dup.3 b/static/inferno/man3/dup.3 new file mode 100644 index 00000000..034501dd --- /dev/null +++ b/static/inferno/man3/dup.3 @@ -0,0 +1,60 @@ +.TH DUP 3 +.SH NAME +dup \- dups of open files +.SH SYNOPSIS +.nf +.B bind #d /fd + +.B /fd/0 +.B /fd/0ctl +.B /fd/1 +.B /fd/1ctl +\&... +.fi +.SH DESCRIPTION +The +.I dup +device serves a one-level directory containing files whose +names are decimal numbers. +Each such file also has an associated control file. +A file of name +.I n +corresponds to open file descriptor +.I n +in the current process. +.PP +A +.IR sys-open (2) +of file +.I n +results in a file descriptor identical to +what would be returned from a system call +.BI sys->dup( n, +.BR -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 400, 200, or 600 (octal) +for the mode, depending on whether the dup target is open +for reading, writing, or both. +.PP +A file of name +.IB n ctl +may be read to discover the properties of the associated file descriptor, in format identical to that of the +.B fd +file in +.IR prog (3). +.SH SEE ALSO +.IR sys-dup (2) +.SH SOURCE +.B /usr/inferno/emu/port/devdup.c +.br +.B /usr/inferno/os/port/devdup.c |
