setlogin

I had a write my own login to duplicate functionality in a QNX2 system I am
porting. In my login, which is spawned in its own session (_SPAWN_SETSID)
from a terminal monitor program (my own again), I do:


chdir (user dir)

setlogin(username)
setuid(0);
setgid(0);
execve (cmd, params, env);

Almost everything works as expected. The problem I am having is that the
user name specified by setlogin() is not visible with “who” and query_sid()
etc. What have I missed? Is there another call (undocumented?) that I have
to make to convince the system that my user has a different login name?

None of my users are in the passwd database. My application has its own
greatly expanded database.

Thanks for all help

Regards
DTHV