IPB
>  Man Pages > Linux > Suse Linux 10.1 > Section 2 > close man page

close man page

Section 2 - Suse Linux 10.1 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!


CLOSE(2)                   Linux Programmer's Manual                  CLOSE(2)




NAME

       close - close a file descriptor


SYNOPSIS

       #include <unistd.h>

       int close(int fd);


DESCRIPTION

       close()  closes  a  file descriptor, so that it no longer refers to any
       file and may be reused.  Any record locks (see fcntl(2))  held  on  the
       file  it  was  associated  with,  and owned by the process, are removed
       (regardless of the file descriptor that was used to obtain the lock).

       If fd is the last copy of a particular file  descriptor  the  resources
       associated  with it are freed; if the descriptor was the last reference
       to a file which has been removed using unlink(2) the file is deleted.


RETURN VALUE

       close() returns zero on success.  On error, -1 is returned,  and  errno
       is set appropriately.


ERRORS

       EBADF  fd isn't a valid open file descriptor.

       EINTR  The close() call was interrupted by a signal.

       EIO    An I/O error occurred.


CONFORMING TO

       SVr4,  SVID,  POSIX, X/OPEN, 4.3BSD.  SVr4 documents an additional ENO-
       LINK error condition.


NOTES

       Not checking the return value of close is  a  common  but  nevertheless
       serious  programming error.  It is quite possible that errors on a pre-
       vious write(2) operation are first reported at the final close().   Not
       checking the return value when closing the file may lead to silent loss
       of data.  This can especially be observed with NFS and with disk quota.

       A  successful  close does not guarantee that the data has been success-
       fully saved to disk, as the kernel defers writes. It is not common  for
       a  filesystem  to  flush  the buffers when the stream is closed. If you
       need to be sure that the data is physically stored use  fsync(2).   (It
       will depend on the disk hardware at this point.)


SEE ALSO

       fcntl(2), fsync(2), open(2), shutdown(2), unlink(2), fclose(3)



                                  2001-12-13                          CLOSE(2)


Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Tue Feb 13 02:17:34 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5323 hits)
(openSUSE 10.2)

svn man page (5161 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4865 hits)
(Solaris 10 11_06)

CPAN man page (4602 hits)
(Suse Linux 10.1)

ssh man page (4337 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2838 hits)
(Solaris 10 11_06)

netcat man page (2687 hits)
(Suse Linux 10.1)

pprosetup man page (2472 hits)
(Solaris 10 11_06)

startproc man page (2450 hits)
(Suse Linux 10.1)

signal man page (2393 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Ski Resorts :: Electronic Circuit Design :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum