Changeset 8ee0aa1 in rtems-libbsd


Ignore:
Timestamp:
Oct 10, 2018, 12:40:47 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
b96abfd647154f10ea8f7fac68e25676636eded5, 7f47f2784138109b8363804c2aecd3d83231ab0f, f1f03620800b14146977d78fb4322d80da04b53a, b6c55e1c57bdf482ee7604480ca589dcd3b6597d
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.