vfs: check userland buffers before reading them.
[haiku.git] / src / tests / servers / input / portspy / PortSpy.cpp
blob4075dabcc2393377c1897dbfebe32f3cf51acd76
1 #include <stdio.h>
2 #include "OS.h"
4 //
5 // Sequentially search for valid ports by port number and display
6 // their properties.
7 //
8 int main(int argc, char* argv[])
10 port_info info;
12 for (int port_num = 0; port_num < 9999; port_num++)
14 if (B_OK == get_port_info(port_num, &info) )
16 // Found a valid port - display it's properties.
18 printf("%04u: Team %u - %s\n",
19 (unsigned int)info.port,
20 (unsigned int)info.team,
21 info.name);
25 return 0;