MLD_WAIT(3)

NAME
mld_wait - wait on an MLD event

SYNOPSIS
#include <mld.h>

int mld_wait(mld_t *mld, unsigned int ifx, struct in6_addr *addr, int flags);

Compile and link with -lmld or -llibrecast depending on whether you have installed the standalone libmld or liblibrecast (with MLD support).

DESCRIPTION
The mld_wait() function waits for an MLD event to occur on interface ifx.

mld must be a pointer to an mld_t initialized with mld_init(3).

addr can either be NULL, or it must be a pointer to a struct in6_addr containing a valid IPv6 multicast address. If NULL, mld_wait() will match events for any multicast address.

The flags argument is the bitwise OR of zero or more of the following flags:

MLD_DONTWAIT
    Enables nonblocking operation; if the operation would block, -1 is returned and errno is set to EWOULDBLOCK.

RETURN VALUE
mld_wait() returns zero on success or -1 on failure, with errno set to indicate the error.

ERRORS
mld_wait() can fail with the following errors:

EWOULDBLOCK
    Nonblocking operation was requested and the requested operation would block.

EINTR
    The operation was interupted by a signal.

ENOMEM
    Out of memory. Possibly, the application hit the RLIMIT_AS or RLIMIT_DATA limit described in getrlimit(2).

mld_init() can also fail with any of the errors for sem_init(3):

EINVAL
    value exceeds SEM_VALUE_MAX.

ENOSYS
    pshared is nonzero, but the system does not support process-shared semaphores (see sem_overview(7)).

SEE ALSO
mld_init(3), mld_free(3), mld_start(3), mld_stop(3), sem_init(3), sem_overview(7)