[PATCH 3/8] tcpdump: Make loop monitor cooperative
Joel Sherrill
joel at rtems.org
Wed May 11 14:56:58 UTC 2022
Should these be inside an ifdef rtems conditional? Isn't this code
originally from FreeBSD?
--joel
On Wed, May 11, 2022 at 1:56 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:
> This helps a bit if the fgetc() is non-blocking.
>
> Update #4650.
> ---
> freebsd/contrib/tcpdump/tcpdump.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/freebsd/contrib/tcpdump/tcpdump.c
> b/freebsd/contrib/tcpdump/tcpdump.c
> index b1e7f0d1..74c878a3 100644
> --- a/freebsd/contrib/tcpdump/tcpdump.c
> +++ b/freebsd/contrib/tcpdump/tcpdump.c
> @@ -139,6 +139,7 @@ The Regents of the University of California. All
> rights reserved.\n";
> #include <sys/sysctl.h>
> #include <machine/rtems-bsd-commands.h>
> #include <assert.h>
> +#include <sched.h>
> #include <rtems.h>
> #include <rtems/linkersets.h>
> #define setpriority(a, b, c)
> @@ -1224,6 +1225,8 @@ pcap_loop_monitor(rtems_task_argument arg)
> pcap_breakloop(pd);
> break;
> }
> +
> + sched_yield();
> }
>
> rtems_task_delete(RTEMS_SELF);
> --
> 2.35.3
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
More information about the devel
mailing list