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

  
 
  

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  as-
     sociated with the handle.

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

     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
     * ECANCELED: Current coroutine was canceled.

     * EINVAL: Invalid argument.

     * ENOMEM: Not enough memory.

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

libdill 								HMAKE(3)

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

home | help