diff --git a/src/tools/PortSpy/PortSpy.cpp b/src/tools/PortSpy/PortSpy.cpp new file mode 100644 index 0000000000..6d6516b002 --- /dev/null +++ b/src/tools/PortSpy/PortSpy.cpp @@ -0,0 +1,26 @@ +#include +#include "OS.h" + +// +// Sequentially search for valid ports by port number and display +// their properties. +// +int main(int argc, char* argv[]) +{ + port_info info; + + for (int port_num = 0; port_num < 9999; port_num++) + { + if (B_OK == get_port_info(port_num, &info) ) + { + // Found a valid port - display it's properties. + // + printf("%04u: Team %u - %s\n", + (unsigned int)info.port, + (unsigned int)info.team, + info.name); + } + } + + return 0; +} \ No newline at end of file diff --git a/src/tools/PortSpy/PortSpy.proj b/src/tools/PortSpy/PortSpy.proj new file mode 100644 index 0000000000..6ab8db3cb0 Binary files /dev/null and b/src/tools/PortSpy/PortSpy.proj differ