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

FreeBSD Manual Pages

  
 
  

home | help
io_getcookie(3) 	    Library Functions Manual		 io_getcookie(3)

NAME
     io_getcookie - retrieve cookie

SYNTAX
     #include <libowfat/io.h>

     void* io_getcookie(int64 fd);

DESCRIPTION
     io_getcookie  retrieves  a cookie (pointer to some anonymous data structure
     you associated with this descriptor).

     Use io_setcookie(3) to associate a cookie with a descriptor.

     If you did not associate a cookie with this  descriptor,  io_getcookie  re-
     turns NULL.

     The  idea	is  that  you put the state associated with a TCP connection you
     serve in a common struct.	Then you do not  need  to  have  your  own  data
     structure to retrieve the state for a connection, you can just use the data
     structure io_wait already maintains.  The lookup works in constant time and
     should not cause any cache misses.

SEE ALSO
     io_wait(3), io_setcookie(3)

								 io_getcookie(3)

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

home | help