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/unix-v10/man2/dup.2 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/unix-v10/man2/dup.2')
| -rw-r--r-- | static/unix-v10/man2/dup.2 | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/static/unix-v10/man2/dup.2 b/static/unix-v10/man2/dup.2 new file mode 100644 index 00000000..e8c7c8b2 --- /dev/null +++ b/static/unix-v10/man2/dup.2 @@ -0,0 +1,54 @@ +.pa 1 +.he 'DUP (II)'1/15/73'DUP (II)' +.ti 0 +NAME dup -- duplicate an open file descriptor +.sp +.ti 0 +SYNOPSIS (file descriptor in r0) +.br +sys dup / dup = 41.; not in assembler +.br +(file descriptor in r0) +.sp +.ti 0 +DESCRIPTION Given +a file descriptor returned from +an open or creat call, +dup___ +will allocate another file descriptor +synonymous +with +the original. +The new file descriptor is returned in r0. +.sp +Dup___ +is used more to manipulate the value +of file descriptors +than to genuinely +duplicate a file descriptor. +Since the algorithm to allocate +file descriptors +is known to use the +lowest available +value between 0 and 9, +combinations of dup___ +and close_____ can be +used to +manipulate file descriptors +in a general way. +This is handy for +manipulating standard input and/or +standard output. +.sp +.ti 0 +SEE ALSO creat(II), open(II), close(II) +.sp +.ti 0 +DIAGNOSTICS The +error bit (c-bit) +is set if: +the given file descriptor is invalid; +there are already 10 open files. +.sp +.ti 0 +BUGS -- |
