| cvs.gedasymbols.org/djgpp/doc/libc/libc_357.html | search | 
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] | 
#include <sys/fsext.h> int __FSEXT_alloc_fd(__FSEXT_Function *_function);  | 
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.  Upon the first call, this
function opens DOS's `NUL' device, so as to allocate a handle that
DOS won't then reuse.  Upon subsequent calls, that handle is duplicated
by calling the DOS dup function; this makes all of the handles
use a single entry in the System File Table, and thus be independent of
what the `FILES=' parameter of `CONFIG.SYS' says.
__FSEXT_alloc_fd also assigns the handler function for the handle
it returns.
The module is responsible for calling _close on the descriptor
after setting the handler function to zero in the extended close
handler.
If successful, a new file descriptor is returned. On error, a negative number
is returned and errno is set to indicate the error.
| ANSI/ISO C | No | 
| POSIX | No | 
int socket()
{
  int fd = __FSEXT_alloc_fd(socket_handler);
  init_socket(fd);
  return fd;
}
 | 
| webmaster | delorie software privacy | 
| Copyright © 2004 | Updated Apr 2004 |