#include
BIO_METHOD * BIO_s_fd(void);
#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) #define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
BIO *BIO_new_fd(int fd, int close_flag);
_B_I_O___r_e_a_d_(_) and _B_I_O___w_r_i_t_e_(_) read or write the underlying descriptor. _B_I_O___p_u_t_s_(_) is supported but _B_I_O___g_e_t_s_(_) is not.
If the close flag is set then then _c_l_o_s_e_(_) is called on the underlying file descriptor when the BIO is freed.
_B_I_O___r_e_s_e_t_(_) attempts to change the file pointer to the start of file using lseek(fd, 0, 0).
_B_I_O___s_e_e_k_(_) sets the file pointer to position ooffss from start of file using lseek(fd, ofs, 0).
_B_I_O___t_e_l_l_(_) returns the current file position by calling lseek(fd, 0, 1).
_B_I_O___s_e_t___f_d_(_) sets the file descriptor of BIO bb to ffdd and the close flag to cc.
_B_I_O___g_e_t___f_d_(_) places the file descriptor in cc if it is not NULL, it also returns the file descriptor. If cc is not NULL it should be of type (int *).
_B_I_O___n_e_w___f_d_(_) returns a file descriptor BIO using ffdd and cclloossee__ffllaagg.
File descriptor BIOs should not be used for socket I/O. Use socket BIOs instead.
_B_I_O___r_e_s_e_t_(_) returns zero for success and -1 if an error occurred. _B_I_O___s_e_e_k_(_) and _B_I_O___t_e_l_l_(_) return the current file position or -1 is an error occurred. These values reflect the underlying _l_s_e_e_k_(_) behaviour.
_B_I_O___s_e_t___f_d_(_) always returns 1.
_B_I_O___g_e_t___f_d_(_) returns the file descriptor or -1 if the BIO has not been initialized.
_B_I_O___n_e_w___f_d_(_) returns the newly allocated BIO or NULL is an error occurred.
BIO *out; out = BIO_new_fd(fileno(stdout), BIO_NOCLOSE); BIO_printf(out, "Hello World\n"); BIO_free(out);