Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ open(2) — Ultrix-11 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

creat(2)

read(2)

write(2)

dup(2)

close(2)

OPEN(2)

NAME

open − open for reading or writing

SYNOPSIS

open(name, mode)
char *name;

DESCRIPTION

Open opens the file name for reading (if mode is 0), writing (if mode is 1) or for both reading and writing (if mode is 2).  Name is the address of a string of ASCII characters representing a path name, terminated by a null character. 

The file is positioned at the beginning (byte 0).  The returned file descriptor must be used for subsequent calls for other input-output functions on the file. 

DIAGNOSTICS

The named file is opened unless one or more of the following is true:

[EACCES] A component of the path prefix denies search permission. 

[EBUSY] The device specified is already open for exclusive use and the caller is not the superuser. 

[EFAULT] Name points outside the process’s allocated address space. 

[EISDIR] The named file is a directory and the arguments specify it is to be opened for writing. 

[EMFILE] The maximum number of file descriptors allowed are already open. 

[ENFILE] No more system file descriptors are available. 

[ENFILE] Insufficient system space to contain i-node. 

[ENOENT] The named file does not exist. 

[ENOTDIR] A component of the path prefix is not a directory. 

[ENXIO] Device special file is not for the current system (major device number is greater than "nchrdev", or greater than "nblkdev"). 

[ENXIO] An attempt was made to open /dev/tty without a controlling terminal. 

[ENXIO] An illegal device was specified, or the device is already open. 

[EROFS] The named file resides on a read-only file system and the file is to be modified. 

[ETO] The specified tape drive is already open. 

[ETOL] The specified tape drive is not on-line. 

[ETPL] Tape position was lost for the specified tape drive. 

[ETWL] The specified tape drive is physically write-locked. 

[ETXTBSY] The file is a pure procedure (shared text) file that is being executed and the open call has requested write access. 

SEE ALSO

creat(2), read(2), write(2), dup(2), close(2)

ASSEMBLER

(open = 5.) 
sys open; name; mode
(file descriptor in r0)

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