Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 1997 11:24:05 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Marcus Haebler <mh@muenster.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: ktrace and getlogin args
Message-ID:  <19971026112405.59913@lemis.com>
In-Reply-To: <Pine.BSF.3.95.971025183518.11983A-100000@ns.muenster.net>; from Marcus Haebler on Sat, Oct 25, 1997 at 06:48:24PM %2B0200
References:  <Pine.BSF.3.95.971025183518.11983A-100000@ns.muenster.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 25, 1997 at 06:48:24PM +0200, Marcus Haebler wrote:
> Hi,
>
> I am trying to run some SCO Binary und ibcs2 and I ran into some problems.
> I started a ktraced the calls. The part where the program fails looks
> like this:
>
>    826 _mprstrt CALL  getlogin(0,0x4f00fefa,0,0x50001,0,0x4f00fefa)
>    826 _mprstrt RET   getlogin 327680/0x50000
>    826 _mprstrt CALL  getlogin(0x1,0x50000,0x2,0xefbfdba4,0x50000,0xefbfdbb0)
>    826 _mprstrt RET   getlogin 0
>    826 _mprstrt CALL  getlogin(0x1,0x50001,0x2,0xefbfdba4,0,0)
>    826 _mprstrt RET   getlogin 0
>    826 _mprstrt CALL  getpid
>    826 _mprstrt RET   getpid 826/0x33a
>    826 _mprstrt CALL  getlogin(0x2,0x50000,0x40ba48,0x960,0x1,0x800)
>    826 _mprstrt RET   getlogin -1 errno 11 Resource deadlock avoided
>    826 _mprstrt CALL  getlogin(0x1,0x50000,0x2,0xefbfdb8c,0,0x49134)
>    826 _mprstrt RET   getlogin 0
>
> My problem right now is, that I don't have any idea what those six
> args to getlogin are. The man pages says that getlogin is (void).
> In the kernel it looks like getlogin has three args. Can someone
> give me any useful tips where I can find some information about
> this or what those args are?

Unless somebody has changed it, ktrace doesn't understand emulations
like ibcs2 and linux.  It looks at the system call number and
translates it to text as if it were a BSD system call.  To find out
what the real system call is, you need to:

1.  Find out the number in /usr/include/sys/syscall.h.  getlogin is
    49, getpid is 20.

2.  Find the corresponding header file on the SCO box (I think it's
    /usr/include/systrap.h or some such) and find out what it means.

Of course, if you're looking for something interesting to do, you
could fix kdump, and people the world round would be eternally
grateful :-)

Greg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971026112405.59913>