MLD_INIT(3)

NAME
mld_init, mld_free - create and free MLD contexts

SYNOPSIS
#include <mld.h>

mld_t *mld_init(int flags);
void mld_free(mld_t *mld);

Compile and link with -lmld.

DESCRIPTION
mld_init() creates a new MLD context and sets up the environment. Call mld_free(3) when done.

mld_free() invalidates and frees a MLD context created with mld_init(3)

RETURN VALUE
mld_init() returns a pointer to a mld_t handle. On error returns NULL and sets errno to indicate the error.

The mld_free() function returns no value.

ERRORS
mld_init() can fail with the following errors:

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)).

EXAMPLE

  Program source
    mld_t *mld;
    mld = mld_init(0);
    /* your program here */
    mld_free(mld); /* free context when done */

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