Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
HMAKE(3)		   libdill Library Functions		      HMAKE(3)

NAME
       hmake - creates a handle

SYNOPSIS
	      #include <libdillimpl.h>

	      struct hvfs {
		  void *(*query)(struct	hvfs *vfs, const void *type);
		  void (*close)(int h);
		  int (*done)(struct hvfs *vfs,	int64_t	deadline);
	      };

	      int hmake(
		  struct hvfs* hvfs);

DESCRIPTION
       A handle	is the user-space equivalent of	a file descriptor.  Coroutines
       and channels are	represented by handles.

       Unlike with file	descriptors, however, you can use the  hmake  function
       to create your own type of handle.

       The  argument of	the function is	a virtual-function table of operations
       associated with the handle.

       When implementing the close  operation,	keep  in  mind	that  invoking
       blocking	 operations  is	 not  allowed,	as blocking operations invoked
       within the context of a close operation will fail with an ECANCELED er-
       ror.

       To close	a handle, use the hclose function.

       hvfs: virtual-function table of operations associated with the handle

RETURN VALUE
       In  case	of success the function	returns	newly created handle.  In case
       of error	it returns -1 and sets errno to	one of the values below.

ERRORS
       o ECANCELED: Current coroutine was canceled.

       o EINVAL: Invalid argument.

       o ENOMEM: Not enough memory.

SEE ALSO
       hclose(3) hown(3) hquery(3)

libdill								      HMAKE(3)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=hmake&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help