GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HOWN(3) libdill Library Functions HOWN(3)

hown - transfer ownership of a handle


#include <libdill.h>
int hown(
    int h);

    

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.

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.

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.


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

    

hclose(3) hclose(3) hmake(3) hquery(3)
libdill

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.