CLOSE(2) UNIX Programmer's Manual CLOSE(2) NAME close - close a file SYNOPSIS close(fildes) DESCRIPTION Given a file descriptor such as returned from an _o_p_e_n, _c_r_e_a_t, _d_u_p or _p_i_p_e(2) call, _c_l_o_s_e closes the associated file. A close of all files is automatic on _e_x_i_t, but since there is a limit on the number of open files per process, _c_l_o_s_e is necessary for programs which deal with many files. Files are closed upon termination of a process, and certain file descriptors may be closed by _e_x_e_c_v_e(2) (see _i_o_c_t_l(2)). RETURN VALUE Upon successful completion, a value of 0 is returned. Oth- erwise, a value of -1 is returned and _e_r_r_n_o is set to indi- cate the error. ERRORS _C_l_o_s_e will fail if: [EBADF] _F_i_l_d_e_s is not an active descriptor. SEE ALSO creat(2), execve(2), ioctl(2), open(2), pipe(2) ASSEMBLER (close = 6.) (file descriptor in r0) sys close Printed 8/5/83 1