コード例 #1
0
ファイル: exec.c プロジェクト: Abocer/android-4.2_r1
static int
exec_IsSet(struct fdescriptor *d, const fd_set *fdset)
{
  struct physical *p = descriptor2physical(d);
  struct execdevice *dev = device2exec(p->handler);
  int result = dev->fd_out >= 0 && FD_ISSET(dev->fd_out, fdset);
  result += physical_IsSet(d, fdset);

  return result;
}
コード例 #2
0
static int
ether_IsSet(struct fdescriptor *d, const fd_set *fdset)
{
  struct physical *p = descriptor2physical(d);
  struct etherdevice *dev = device2ether(p->handler);
  int result;

  result = dev->cs >= 0 && FD_ISSET(dev->cs, fdset);
  result += physical_IsSet(d, fdset);

  return result;
}
コード例 #3
0
ファイル: netgraph.c プロジェクト: vishesh/DragonFlyBSD
static void
ng_DescriptorRead(struct fdescriptor *d, struct bundle *bundle,
                  const fd_set *fdset)
{
    struct physical *p = descriptor2physical(d);
    struct ngdevice *dev = device2ng(p->handler);

    if (dev->cs >= 0 && FD_ISSET(dev->cs, fdset))
        ng_MessageIn(p, NULL, 0);

    if (physical_IsSet(d, fdset))
        physical_DescriptorRead(d, bundle, fdset);
}
コード例 #4
0
static void
ether_DescriptorRead(struct fdescriptor *d, struct bundle *bundle,
                     const fd_set *fdset)
{
  struct physical *p = descriptor2physical(d);
  struct etherdevice *dev = device2ether(p->handler);

  if (dev->cs >= 0 && FD_ISSET(dev->cs, fdset)) {
    ether_MessageIn(dev);
    if (dev->connected == CARRIER_LOST) {
      log_Printf(LogPHASE, "%s: Device disconnected\n", p->link.name);
      datalink_Down(p->dl, CLOSE_NORMAL);
      return;
    }
  }

  if (physical_IsSet(d, fdset))
    physical_DescriptorRead(d, bundle, fdset);
}
コード例 #5
0
static int
chat_IsSet(struct fdescriptor *d, const fd_set *fdset)
{
  struct chat *c = descriptor2chat(d);
  return c->argptr && physical_IsSet(&c->physical->desc, fdset);
}