Convert qnx_name_locate & qnx_name_query to name_open()

Hai QNX lovers,

I have trouble to convert this function to QNX 6.3 application.
Please help me.?

char *GetPidStr( pid_t pidThis )
{
static char acTaskname[80];
pid_t pidThat;
struct _nameinfo buff;
int id;

sprintf( acTaskname, “%s”, “UNKNOWN” );
/* MIG4NTO qnx_name_query Names registered via name_attach() (QNX Neutrino /
/
MIG4NTO 2.1 or later) appear in /dev/name/local and /
/
MIG4NTO /dev/name/global. /
for ( id = 0; (id = qnx_name_query( 0, id, &buff )) != -1; id++ )
{
/
MIG4NTO qnx_name_locate If you are using QNX Neutrino 2.1 or later then /
/
MIG4NTO use name_open() or write resource managers /
/
MIG4NTO instead. If you are using QNX Neutrino 2.0 or /
/
MIG4NTO earlier then consider writing a resource manager /
/
MIG4NTO instead. The migration guide also lists some /
/
MIG4NTO other methods for the sender to find the receiver. */
pidThat = qnx_name_locate( 0, buff.name, 0, NULL );
if ( pidThis == pidThat )
{
//BINGO!
sprintf( acTaskname, “%s”, buff.name );
}
}
return acTaskname;
}