Which ping implementation is Cygwin using?

19

1

What is the source of the implementation of ping is Cygwin using?

It apparently isn't GNU ping (because in GNU ping, the number of pings to send is decided with -c X, while in Cygwin ping, it's decided with -n X).

Is it a custom ping? BusyBox ping? Toybox ping? NetBSD ping? OpenBSD ping? FreeBSD ping? Something else?

hanshenrik

Posted 2019-09-09T08:00:49.713

Reputation: 447

Answers

45

It's Windows ping. Just run:

which ping 

You'll get:

/cygdrive/c/WINDOWS/system32/ping

David Dai

Posted 2019-09-09T08:00:49.713

Reputation: 2 833

There's this github thread that confirms: https://github.com/msys2/MSYS2-packages/issues/153

– Bernhard Döbler – 2019-09-10T11:54:01.273

In case it's not clear to someone from reading this answer, this is the built-in ping command in Windows, not any sort of *nix ping command. – reirab – 2019-09-11T21:37:30.937

11

Cygwin ping is available on ping package from inetutils source

$ which ping
/usr/bin/ping 

$ cygcheck -f `which ping`
ping-1.9.4-1

x86_64 $ ping --help
Usage: ping [OPTION...] HOST ...
Send ICMP ECHO_REQUEST packets to network hosts.

 Options controlling ICMP request types:
      --address              send ICMP_ADDRESS packets (root only)
      --echo                 send ICMP_ECHO packets (default)
      --mask                 same as --address
      --timestamp            send ICMP_TIMESTAMP packets
  -t, --type=TYPE            send TYPE packets

 Options valid for all request types:

  -c, --count=NUMBER         stop after sending NUMBER packets
....

matzeri

Posted 2019-09-09T08:00:49.713

Reputation: 1 662

7

You should use command -v ping, not which ping. Also see How to check if a program exists from a Bash script? and the discussion around Posix and environments.

– jww – 2019-09-10T02:53:44.337

And which ping implementation is that? – OrangeDog – 2019-09-10T09:44:43.550

GNU https://www.gnu.org/software/inetutils/

– matzeri – 2019-09-10T22:02:36.000

@jww command -v ping and which ping produces exactly the same output on my system as the ping package is installed. Eventually you can use which -a ping – matzeri – 2019-09-10T22:08:49.577

@matzeri the point is it won't on everyone else's system – OrangeDog – 2019-09-11T16:18:54.780

@OrangeDog the question was about cygwin ping not windows ping. So you need the ping package installed if you want it. – matzeri – 2019-09-11T18:28:25.087