/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* number of selected fd's returned
*/
#include "cslib.h"
#ifdef POLLIST
#endif
#if _sys_select && !defined(FD_SET)
#endif
int
{
#if CS_LIB_SOCKET || CS_LIB_V10
register int events;
register int width;
#if CS_LIB_SOCKET
if (ms >= 0)
{
}
else tp = 0;
#endif
{
{
events |= CS_POLL_READ;
}
{
events |= CS_POLL_WRITE;
}
{
#if CS_LIB_SOCKET
#endif
}
}
if (!(events & CS_POLL_WRITE))
wp = 0;
#if CS_LIB_SOCKET
if (!(events & CS_POLL_READ))
rp = 0;
if (!(events & CS_POLL_CONTROL))
ep = 0;
messagef((state->id, NiL, -6, "poll: %s num=%d ms=%d sec=%d usec=%d", fmttime("%K", CSTIME()), num, ms, tp ? tp->tv_sec : 0, tp ? tp->tv_usec : 0));
#else
rp = 0;
#endif
if (num < 0)
else
{
{
{
#if CS_LIB_V10
long n;
else if (!n)
else
#endif
}
#if CS_LIB_SOCKET
#endif
{
num++;
}
}
}
return num;
#else
#if CS_LIB_STREAM
int n;
#if _lib_poll_fd_2
#else
#endif
if (n < 0)
else if (n > 0)
{
int i;
#ifdef RS_HIPRI
#endif
{
{
#ifdef RS_HIPRI
{
int f = RS_HIPRI;
}
#endif
if (--i <= 0)
break;
}
}
}
return n;
#else
return -1;
#endif
#endif
}
int
{
}