doc/cxxapi/classPassenger_1_1FileDescriptor.html in passenger-3.0.0 vs doc/cxxapi/classPassenger_1_1FileDescriptor.html in passenger-3.0.1

- old
+ new

@@ -40,19 +40,21 @@ <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#a05d83ad9cc77c493a3ce4f2b51d44559">FileDescriptor</a> ()</td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new empty <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> instance that has no underlying file descriptor. <a href="#a05d83ad9cc77c493a3ce4f2b51d44559"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#a62c05b925cb1cf964169cef7635650ee">FileDescriptor</a> (int fd)</td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> instance with the given fd as a handle. <a href="#a62c05b925cb1cf964169cef7635650ee"></a><br/></td></tr> -<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432">close</a> ()</td></tr> -<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the underlying file descriptor. <a href="#ad7c1a99531181878cbab74a7400c5432"></a><br/></td></tr> +<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b">close</a> (bool checkErrors=true)</td></tr> +<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close the underlying file descriptor. <a href="#a02062f3cfb689b32781e11114c0abe5b"></a><br/></td></tr> +<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ad9f7acde3003ab0730bc248948a63777">detach</a> ()</td></tr> +<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Detach from the underlying file descriptor without closing it. <a href="#ad9f7acde3003ab0730bc248948a63777"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1FileDescriptor.html#ac335c2a97f3a6c8e3920f573b0d04081">operator int</a> () const </td></tr> <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloads the integer cast operator so that it will return the underlying file descriptor handle as an integer. <a href="#ac335c2a97f3a6c8e3920f573b0d04081"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Wrapper class around a file descriptor integer, for RAII behavior. </p> -<p>A <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> object behaves just like an int, so that you can pass it to system calls such as read(). It performs reference counting. When the last copy of a <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> has been destroyed, the underlying file descriptor will be automatically closed. In this case, any <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">close()</a> system call errors are silently ignored. If you are interested in whether the <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">close()</a> system call succeeded, then you should call <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a>.</p> -<p>This class is *not* thread-safe. It is safe to call system calls on the underlying file descriptor from multiple threads, but it's not safe to call <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a> from multiple threads if all those <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> objects point to the same underlying file descriptor. </p> +<p>A <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> object behaves just like an int, so that you can pass it to system calls such as read(). It performs reference counting. When the last copy of a <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> has been destroyed, the underlying file descriptor will be automatically closed. In this case, any <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">close()</a> system call errors are silently ignored. If you are interested in whether the <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">close()</a> system call succeeded, then you should call <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a>.</p> +<p>This class is *not* thread-safe. It is safe to call system calls on the underlying file descriptor from multiple threads, but it's not safe to call <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a> from multiple threads if all those <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> objects point to the same underlying file descriptor. </p> <hr/><h2>Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a05d83ad9cc77c493a3ce4f2b51d44559"></a><!-- doxytag: member="Passenger::FileDescriptor::FileDescriptor" ref="a05d83ad9cc77c493a3ce4f2b51d44559" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> @@ -92,37 +94,61 @@ <dl class="post"><dt><b>Postcondition:</b></dt><dd>*this == fd </dd></dl> </div> </div> <hr/><h2>Member Function Documentation</h2> -<a class="anchor" id="ad7c1a99531181878cbab74a7400c5432"></a><!-- doxytag: member="Passenger::FileDescriptor::close" ref="ad7c1a99531181878cbab74a7400c5432" args="()" --> +<a class="anchor" id="a02062f3cfb689b32781e11114c0abe5b"></a><!-- doxytag: member="Passenger::FileDescriptor::close" ref="a02062f3cfb689b32781e11114c0abe5b" args="(bool checkErrors=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Passenger::FileDescriptor::close </td> <td>(</td> - <td class="paramname"></td> + <td class="paramtype">bool&nbsp;</td> + <td class="paramname"> <em>checkErrors</em> = <code>true</code></td> <td>&nbsp;)&nbsp;</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Close the underlying file descriptor. </p> <p>If it was already closed, then nothing will happen. If there are multiple copies of this <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> then the underlying file descriptor will be closed for every one of them.</p> +<p>checkErrors Whether a <a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a> should be thrown in case closing the file descriptor fails. If false, errors are silently ignored. </p> <dl><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> - <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a></em>&nbsp;</td><td>Something went wrong while closing the file descriptor. </td></tr> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a></em>&nbsp;</td><td>Something went wrong while closing the file descriptor. Only thrown if checkErrors is true. </td></tr> </table> </dd> </dl> <dl class="post"><dt><b>Postcondition:</b></dt><dd>*this == -1 </dd></dl> </div> </div> +<a class="anchor" id="ad9f7acde3003ab0730bc248948a63777"></a><!-- doxytag: member="Passenger::FileDescriptor::detach" ref="ad9f7acde3003ab0730bc248948a63777" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int Passenger::FileDescriptor::detach </td> + <td>(</td> + <td class="paramname"></td> + <td>&nbsp;)&nbsp;</td> + <td><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p>Detach from the underlying file descriptor without closing it. </p> +<p>This <a class="el" href="classPassenger_1_1FileDescriptor.html" title="Wrapper class around a file descriptor integer, for RAII behavior.">FileDescriptor</a> and all copies will no longer affect the underlying file descriptors.</p> +<dl class="return"><dt><b>Returns:</b></dt><dd>The underlying file descriptor, or -1 if already closed. </dd></dl> +<dl class="post"><dt><b>Postcondition:</b></dt><dd>*this == -1 </dd></dl> + +</div> +</div> <a class="anchor" id="ac335c2a97f3a6c8e3920f573b0d04081"></a><!-- doxytag: member="Passenger::FileDescriptor::operator int" ref="ac335c2a97f3a6c8e3920f573b0d04081" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> @@ -135,10 +161,10 @@ </table> </div> <div class="memdoc"> <p>Overloads the integer cast operator so that it will return the underlying file descriptor handle as an integer. </p> -<p>Returns -1 if <a class="el" href="classPassenger_1_1FileDescriptor.html#ad7c1a99531181878cbab74a7400c5432" title="Close the underlying file descriptor.">FileDescriptor::close()</a> was called. </p> +<p>Returns -1 if <a class="el" href="classPassenger_1_1FileDescriptor.html#a02062f3cfb689b32781e11114c0abe5b" title="Close the underlying file descriptor.">FileDescriptor::close()</a> was called. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="FileDescriptor_8h_source.html">FileDescriptor.h</a></li>