Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>__fsext_alloc_fd</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
__FSEXT_alloc_fd
================

Syntax
------

     #include <sys/fsext.h>
     
     int __FSEXT_alloc_fd(__FSEXT_Function *_function);

Description
-----------

This function is part of the File System Extensions:.  It is used   
by extensions that fully emulate the I/O functions, and thus don't have
a corresponding DOS file handle.  This function opens DOS's `NUL'
device, so as to allocate a handle that DOS won't then reuse.  It also
assigns the handler function for that descriptor.

The module is responsible for calling `_close' on the descriptor after
setting the handler function to zero in the extended close handler.

Example
-------


     int socket()
     {
       int fd = __FSEXT_alloc_fd(socket_handler);
       init_socket(fd);
       return fd;
     }


See Also: File System Extensions

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson