net-snmp 5.7
Functions
large_fd_set.c File Reference

Macro's and functions for manipulation of large file descriptor sets. More...

#include <net-snmp/net-snmp-config.h>
#include <stdio.h>
#include <string.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/library/snmp_assert.h>
#include <net-snmp/library/large_fd_set.h>

Go to the source code of this file.

Functions

void netsnmp_large_fd_setfd (int fd, netsnmp_large_fd_set *fdset)
void netsnmp_large_fd_clr (int fd, netsnmp_large_fd_set *fdset)
int netsnmp_large_fd_is_set (int fd, netsnmp_large_fd_set *fdset)
void netsnmp_large_fd_set_init (netsnmp_large_fd_set *fdset, int setsize)
 Initialize a netsnmp_large_fd_set structure.
int netsnmp_large_fd_set_select (int numfds, netsnmp_large_fd_set *readfds, netsnmp_large_fd_set *writefds, netsnmp_large_fd_set *exceptfds, struct timeval *timeout)
 Synchronous I/O multiplexing for large file descriptor sets.
void netsnmp_large_fd_set_resize (netsnmp_large_fd_set *fdset, int setsize)
 Modify the size of a file descriptor set and preserve the first min(fdset->lfs_setsize, setsize) file descriptors.
void netsnmp_large_fd_set_cleanup (netsnmp_large_fd_set *fdset)
 Deallocate the memory allocated by netsnmp_large_fd_set_init.
void netsnmp_copy_fd_set_to_large_fd_set (netsnmp_large_fd_set *dst, const fd_set *src)
 Copy an fd_set to a netsnmp_large_fd_set structure.
int netsnmp_copy_large_fd_set_to_fd_set (fd_set *dst, const netsnmp_large_fd_set *src)
 Copy a netsnmp_large_fd_set structure into an fd_set.

Detailed Description

Macro's and functions for manipulation of large file descriptor sets.

Definition in file large_fd_set.c.


Function Documentation

void netsnmp_copy_fd_set_to_large_fd_set ( netsnmp_large_fd_set dst,
const fd_set *  src 
)

Copy an fd_set to a netsnmp_large_fd_set structure.

Note:
dst must have been initialized before this function is called.

Definition at line 191 of file large_fd_set.c.

int netsnmp_copy_large_fd_set_to_fd_set ( fd_set *  dst,
const netsnmp_large_fd_set src 
)

Copy a netsnmp_large_fd_set structure into an fd_set.

Returns:
0 upon success, -1 when copying fails because *src is too large to fit into *dst.

Definition at line 199 of file large_fd_set.c.

void netsnmp_large_fd_set_cleanup ( netsnmp_large_fd_set fdset)

Deallocate the memory allocated by netsnmp_large_fd_set_init.

Definition at line 183 of file large_fd_set.c.

void netsnmp_large_fd_set_init ( netsnmp_large_fd_set fdset,
int  setsize 
)

Initialize a netsnmp_large_fd_set structure.

Note: this function only initializes the lfs_setsize and lfs_setptr members of netsnmp_large_fd_set, not the file descriptor set itself. The file descriptor set must be initialized separately, e.g. via NETSNMP_LARGE_FD_CLR().

Definition at line 113 of file large_fd_set.c.

void netsnmp_large_fd_set_resize ( netsnmp_large_fd_set fdset,
int  setsize 
)

Modify the size of a file descriptor set and preserve the first min(fdset->lfs_setsize, setsize) file descriptors.

Definition at line 143 of file large_fd_set.c.

int netsnmp_large_fd_set_select ( int  numfds,
netsnmp_large_fd_set readfds,
netsnmp_large_fd_set writefds,
netsnmp_large_fd_set exceptfds,
struct timeval *  timeout 
)

Synchronous I/O multiplexing for large file descriptor sets.

On POSIX systems, any file descriptor set with size below numfds will be resized before invoking select().

See also:
See also select(2) for more information.

Definition at line 121 of file large_fd_set.c.