Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

creat (II)

open (II)

pipe (II)

WRITE(II)  −  PWB/UNIX 8/5/73

NAME

write − write on a file

SYNOPSIS

(write = 4.) 
(file descriptor in r0)
sys  write; buffer; nbytes write(fildes, buffer, nbytes)
char *buffer;

DESCRIPTION

A file descriptor is a word returned from a successful open, creat, dup, or pipe call.  Buffer is the address of nbytes contiguous bytes which are written on the output file.  The number of characters actually written is returned (in r0).  It should be regarded as an error if this is not the same as requested.  Writes which are multiples of 512 characters long and begin on a 512-byte boundary in the file are more efficient than any others.

SEE ALSO

creat (II), open (II), pipe (II)

DIAGNOSTICS

The error bit (c-bit) is set on an error: bad descriptor, buffer address, or count; physical I/O errors.  From C, a returned value of −1 indicates an error. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026