Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ close(2) — GL1 W2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

creat(2)

dup(2)

exec(2)

fcntl(2)

open(2)

pipe(2)

CLOSE(2)  —  Silicon Graphics

NAME

close − close a file descriptor

SYNOPSIS

int close (fildes)
int fildes;

DESCRIPTION

Fildes is a file descriptor obtained from a creat, open, dup, fcntl, or pipe system call.  Close closes the file descriptor indicated by fildes. A close of all files is automatic on exit, but since there is a 20 open file limit on the number of open files per process, close is necessary for programs which deal with many files. 

Close will fail if fildes is not a valid open file descriptor.  ­[EBADF]

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

SEE ALSO

creat(2), dup(2), exec(2), fcntl(2), open(2), pipe(2). 

ASSEMBLER

moveq#6,D0
movlfildes,A0
trap#0

Carry bit set on failure and cleared on success. 

Version 2.1  —  January 02, 1985

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