1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- For sockets, ioctl() and fcntl() now interact on the FIONBIO/FIOASYNC

requests (ioctl) and the O_NOBLOCK/O_ASYNC flags (fcntl).


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14775 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-11-27 12:43:12 +00:00
parent 24ea9161a7
commit be2d80a86a
6 changed files with 96 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_hook_entry.c,v 1.1.1.1 2004-07-26 16:31:14 obarthel Exp $
* $Id: socket_hook_entry.c,v 1.2 2004-11-27 12:43:11 obarthel Exp $
*
* :ts=4
*
@ -41,6 +41,10 @@
/****************************************************************************/
#include <sys/ioctl.h>
/****************************************************************************/
void
__socket_hook_entry(
struct Hook * UNUSED unused_hook,
@ -49,6 +53,7 @@ __socket_hook_entry(
{
struct FileInfoBlock * fib;
int error = OK;
int param;
int result;
assert( message != NULL && fd != NULL );
@ -129,6 +134,28 @@ __socket_hook_entry(
break;
case file_hook_action_set_blocking:
SHOWMSG("file_hook_action_set_blocking");
param = (int)(message->block == 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,&param);
error = errno;
break;
case file_hook_action_set_async:
SHOWMSG("file_hook_action_set_async");
param = (int)(message->block != 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,&param);
error = errno;
break;
case file_hook_action_examine:
SHOWMSG("file_hook_action_examine");