summaryrefslogtreecommitdiffstats
path: root/docs/nspr/reference/pr_close.rst
blob: 1bf310c495595a4a59f2d1aad26b74bf86117d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PR_Close
========

Closes a file descriptor.


Syntax
------

.. code::

   #include <prio.h>

   PRStatus PR_Close(PRFileDesc *fd);


Parameters
~~~~~~~~~~

The function has the following parameters:

``fd``
   A pointer to a :ref:`PRFileDesc` object.


Returns
~~~~~~~

One of the following values:

-  If file descriptor is closed successfully, ``PR_SUCCESS``.
-  If the file descriptor is not closed successfully, ``PR_FAILURE``.


Description
-----------

The file descriptor may represent a normal file, a socket, or an end
point of a pipe. On successful return, :ref:`PR_Close` frees the dynamic
memory and other resources identified by the ``fd`` parameter.