SocketError : on " getservbyname( ) " Please

I try to setup my QNX PC as sample server . my program can not get server name form /etc/service . so how to slove it.

sinfo = getservbyname(“myserver”,“tcp”);
if (sinfo == NULL) {
printf(“ERROR: myserver not found in /etc/services\n”);
exit(UNSUPPORTED_SERVICE);
}

Is “myserver” in /etc/services ?
grep myserver /etc/services

what is grep

There is a couple of common ways to lookup command help in qnx.

The first way is the command “use”
eg: use grep
This will, atleast, get you a list of options and maybe more.

The second way is by using the Help system. It’s in the Launch menu and at the top of the Shelf and it’s real name is “helpviewer”. Inside of help you will find the commands all tucked away under QNX Neutrino RTOS → Utilities Reference. And under the letter G you will find “grep”.