Manual Pages for UNIX Darwin command on man BIO_get_fd
MyWebUniversity

Manual Pages for UNIX Darwin command on man BIO_get_fd

BIOsfd(3) OpenSSL BIOsfd(3)

NAME

BIOsfd, BIOsetfd, BIOgetfd, BIOnewfd - file descriptor BIO

SYNOPSIS

#include

BIOMETHOD * BIOsfd(void);

#define BIOsetfd(b,fd,c) BIOintctrl(b,BIOCSETFD,c,fd)

#define BIOgetfd(b,c) BIOctrl(b,BIOCGETFD,0,(char *)c)

BIO *BIOnewfd(int fd, int closeflag);

DESCRIPTION

BIOsfd() returns the file descriptor BIO method. This is a wrapper round the platforms file descriptor routines such as read() and write(). BIOread() and BIOwrite() read or write the underlying descriptor. BIOputs() is supported but BIOgets() is not. If the close flag is set then then close() is called on the underlying file descriptor when the BIO is freed. BIOreset() attempts to change the file pointer to the start of file using lseek(fd, 0, 0). BIOseek() sets the file pointer to position ooffss from start of file using lseek(fd, ofs, 0). BIOtell() returns the current file position by calling lseek(fd, 0, 1). BIOsetfd() sets the file descriptor of BIO bb to ffdd and the close flag to cc. BIOgetfd() 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 *). BIOnewfd() returns a file descriptor BIO using ffdd and cclloosseeffllaagg. NNOOTTEESS The behaviour of BIOread() and BIOwrite() depends on the behavior of the platforms read() and write() calls on the descriptor. If the underlying file descriptor is in a non blocking mode then the BIO will behave in the manner described in the BIOread(3) and BIOshouldretry(3) manual pages. File descriptor BIOs should not be used for socket I/O. Use socket BIOs instead.

RETURN VALUES

BIOsfd() returns the file descriptor BIO method.

BIOreset() returns zero for success and -1 if an error occurred.

BIOseek() and BIOtell() return the current file position or -1 is an

error occurred. These values reflect the underlying lseek() behaviour. BIOsetfd() always returns 1.

BIOgetfd() returns the file descriptor or -1 if the BIO has not been

initialized. BIOnewfd() returns the newly allocated BIO or NULL is an error occurred. EEXXAAMMPPLLEE This is a file descriptor BIO version of "Hello World": BIO *out; out = BIOnewfd(fileno(stdout), BIONOCLOSE); BIOprintf(out, "Hello World\n"); BIOfree(out);

SEE ALSO

BIOseek(3), BIOtell(3), BIOreset(3), BIOread(3), BIOwrite(3), BIOputs(3), BIOgets(3), BIOprintf(3), BIOsetclose(3), BIOgetclose(3)

0.9.7l 2000-09-17 BIOsfd(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™