libdill: Structured Concurrency for C

NAME

hclose - hard-cancels a handle

SYNOPSIS

#include <libdill.h>

int hclose(int h);

DESCRIPTION

Closes a handle.

Once all handles pointing to the same underlying object have been closed, the object is deallocated immediately.

The function guarantees that all associated resources are deallocated. However, it does
not guarantee that the handle's work will have been fully finished. E.g., outbound network data may not be flushed.

RETURN VALUE

Returns a coroutine handle. In the case of an error, it returns -1 and sets errno to one of the values.

ERRORS

EXAMPLE

int ch = chmake(sizeof(int));
hclose(ch);