Changeset 8ee0aa1 in rtems-libbsd


Ignore:
Timestamp:
Oct 10, 2018, 12:40:47 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
647dd08ae2aa69b935c2847ea450fb824322ecae, c6261f97870562d4c797cfb1ff1ba0affb85a916
Children:
4a5f546
Parents:
175c1f8
git-author:
Sebastian Huber <sebastian.huber@…> (10/10/18 12:40:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/10/18 12:41:19)
Message:

PING(8): Honour file descriptor maximum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sbin/ping/ping.c

    r175c1f8 r8ee0aa1  
    7676#include <machine/rtems-bsd-program.h>
    7777#include <machine/rtems-bsd-commands.h>
     78#include <rtems/libio_.h>
    7879#endif /* __rtems__ */
    7980#include <sys/param.h>          /* NB: we rely on this for <sys/types.h> */
     
    977978        while (!finish_up) {
    978979                struct timeval now, timeout;
     980#ifndef __rtems__
    979981                fd_set rfds;
     982#else /* __rtems__ */
     983                fd_set big_enough_rfds[howmany(rtems_libio_number_iops,
     984                    sizeof(fd_set) * 8)];
     985#define rfds (*(fd_set *)(&big_enough_rfds[0]))
     986#endif /* __rtems__ */
    980987                int cc, n;
    981988
    982989                check_status();
     990#ifndef __rtems__
    983991                if ((unsigned)srecv >= FD_SETSIZE)
    984992                        errx(EX_OSERR, "descriptor too large");
    985993                FD_ZERO(&rfds);
     994#else /* __rtems__ */
     995                memset(big_enough_rfds, 0, sizeof(big_enough_rfds));
     996#endif /* __rtems__ */
    986997                FD_SET(srecv, &rfds);
    987998                (void)gettimeofday(&now, NULL);
Note: See TracChangeset for help on using the changeset viewer.