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

  
 
  

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 ob-
     ject.  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
     * EBADF: Invalid handle.

     * EMFILE: The maximum number of file descriptors in the process are already
       open.

     * ENFILE: The maximum number of file descriptors in the system are  already
       open.

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

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

home | help