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

FreeBSD Manual Pages

  
 
  

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

NAME
       hown - transfer ownership of a handle

SYNOPSIS
	      #include <libdill.h>

	      int hown(
		  int h);

DESCRIPTION
       Handles	are integers.  You own a handle	if you know its	numeric	value.
       To transfer ownership this function changes the number associated  with
       the object.  The	old number becomes invalid and using it	will result in
       undefined behavior.  The	new number can be used in exactly the same way
       as the old one would.

       If the function fails, the old handle is	closed.

       h: Handle to transfer.

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

ERRORS
       o EBADF:	Invalid	handle.

       o EMFILE: The maximum number of file descriptors	in the process are al-
	 ready open.

       o ENFILE:  The maximum number of	file descriptors in the	system are al-
	 ready open.

       o ENOMEM: Not enough memory.

EXAMPLE
	      int h1 = tcp_connect(&addr, deadline);
	      int h2 = hown(h1);
	      /* h1 is invalid here */
	      hclose(h2);

SEE ALSO
       hclose(3) hclose(3) hmake(3) hquery(3)

libdill								       HOWN(3)

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

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

home | help