
#use wml::openssl-macros area=docs page=SSL_get_fd

<title>Documents, SSL_get_fd(3)</title>

<h1>SSL_get_fd(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_get_fd - get file descriptor linked to an SSL object

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> int SSL_get_fd(const SSL *ssl);
 int SSL_get_rfd(const SSL *ssl);
 int SSL_get_wfd(const SSL *ssl);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_get_fd()</CODE> returns the file descriptor which is linked to <STRONG>ssl</STRONG>. <CODE>SSL_get_rfd()</CODE> and <CODE>SSL_get_wfd()</CODE> return the file
descriptors for the read or the write channel, which can be different. If
the read and the write channel are different, <CODE>SSL_get_fd()</CODE>
will return the file descriptor of the read channel.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
The following return values can occur:

</P>
<DL>
<DT><STRONG><A NAME="item__1">-1</A></STRONG><DD>
<P>
The operation failed, because the underlying BIO is not of the correct type
(suitable for file descriptors).

</P>
<DT><STRONG><A NAME="item_gt">&gt;=0</A></STRONG><DD>
<P>
The file descriptor linked to <STRONG>ssl</STRONG>.

</P>
</DL>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/SSL_set_fd.html#">SSL_set_fd(3)</A>, <A HREF="../ssl/ssl.html#">ssl(3)</A> , <A HREF="../crypto/bio.html#">bio(3)</A>



</P>
:}


