setlogin()??

Hi All,

I’ve been preparing our development system for a major system wide series of
upgrades… and was hoping to finally get rid of Watcom 9.52… but, after
recompiling a custom mgetty utility with Watcom 10.6, I’ve discovered that
setlogin() doesn’t seem to work with 10.6. I’ve verified that it’s in the
unix3r.lib, but it doesn’t do anything except return -1. What’s the deal
here? Is there a replacement or special library I need to link with?

-Rob

OK… More info…

I found the instructions in the Knowledge Base for how to build a phlogin
replacement and tried the struct _proc_session message thingie. It doesn’t
seem to work either. Obviously there has to be a way to do this or all the
standard login, rlogin, telnet, etc. utilities wouldn’t work.

Please tell me how?

TIA
-Rob

“Rob” <rob@spamyouself.com> wrote in message
news:bkpvfn$b37$1@inn.qnx.com

Hi All,

I’ve been preparing our development system for a major system wide series
of
upgrades… and was hoping to finally get rid of Watcom 9.52… but, after
recompiling a custom mgetty utility with Watcom 10.6, I’ve discovered that
setlogin() doesn’t seem to work with 10.6. I’ve verified that it’s in the
unix3r.lib, but it doesn’t do anything except return -1. What’s the deal
here? Is there a replacement or special library I need to link with?

-Rob

Nevermind :wink:

I figured it out. I was setting sid wrong in the proc message. It would
be nice if someone fixed setlogin() though :slight_smile:

Here’s the code that works, incase anyone is interested…

#include <sys/kernel.h>
#include <sys/proc_msg.h>

static int sid_name( const char *name )
{
struct _proc_session ps;
u_short s = 0;

memset( &ps, 0, sizeof( ps ) );
ps.type = _PROC_SESSION;
ps.subtype = _PROC_SUB_ACTION1;
ps.sid = getsid( getpid( ) );
strncpy( ps.name, name, 16 );

Send( PROC_PID, &ps, &s, sizeof( ps ), sizeof( s ) );

return( s );
}

-Rob

“Rob” <rob@spamyouself.com> wrote in message
news:bkq9sg$ib2$1@inn.qnx.com

OK… More info…

I found the instructions in the Knowledge Base for how to build a phlogin
replacement and tried the struct _proc_session message thingie. It
doesn’t
seem to work either. Obviously there has to be a way to do this or all
the
standard login, rlogin, telnet, etc. utilities wouldn’t work.

Please tell me how?

TIA
-Rob

“Rob” <> rob@spamyouself.com> > wrote in message
news:bkpvfn$b37$> 1@inn.qnx.com> …
Hi All,

I’ve been preparing our development system for a major system wide
series
of
upgrades… and was hoping to finally get rid of Watcom 9.52… but,
after
recompiling a custom mgetty utility with Watcom 10.6, I’ve discovered
that
setlogin() doesn’t seem to work with 10.6. I’ve verified that it’s in
the
unix3r.lib, but it doesn’t do anything except return -1. What’s the
deal
here? Is there a replacement or special library I need to link with?

-Rob
\