CLOSE - close a file descriptor.

(Compatible with UNIX System V C)

Usage:

#include <fildes.h>
ret = close( fd );

Where:

int fd;
is a valid file descriptor as returned by "open" or "creat".
int ret;
is 0 if the close operation was successful. Otherwise a -1 is returned and the library variable "errno" is set to EBADF.

Description:

"close" closes a file descriptor.

Notes:

This function exists solely for compatibility with existing software. New programs should use the FCLOSE function instead.

It is important that you #include the <fildes.h> file. If you do not, the reference to "close" will be incorrectly resolved to refer to a different, incompatible function.

See Also:

expl c lib open

expl c lib creat

expl c lib errno

expl c include fildes

Copyright © 1996, Thinkage Ltd.