From: Jeff Denham <jdenham@allaire.com>
Subject: Re: Process unique number ?
Date: 1999/08/02 [thread overview]
Message-ID: <37A5A782.1AE078F1@allaire.com> (raw)
In-Reply-To: 37A2DC56.64C1BC99@cybercable.fr
Jonathan Perret wrote:
> Hello,
>
> I have quite a low-level question on Digital UNIX on Alpha :
> What do the wrunique and rdunique PAL calls do ?
> I know they read and write the "process unique number", but can anybody
> enlighten me on what this number is (a pointer to documentation would be more
> than fine) ? Are they related to ASNs ?
It's acutally a "thread unique number" and is used internally by
the OS to manage the threads in a process. Although you
can call wrunique from a user-mode program, you won't be
happy with the results. You can use rdunique to get
get a pointer to the thread control block (TCB) of the calling
thread. This structure is defined in a public header file
(which? pthread.h maybe) and can tell you some mildly
interesting things about your current thread.
> In the same vein, is there documentation anywhere on the Digital UNIX system
> call interface ? I'm not talking about the seciton 2 man pages here, I need to
> know what goes on underneath the libc wraparound.
I don't believe it's documented anywhere, but you can certainly
figure out what's going on by instruction-stepping through some
library calls in the debugger. If I recall you drop SYS_# (see
syscall.h) into $v0 and call call_pal CALL_SYS. On return,
you get some results/status back in a few registers. Single-stepping
will show you which.
Be aware that some system call entry points in libc are simply
"stubs" -- they load the syscall number and do the pal call.
The getpid() syscall is a good example. Others, maintain
some state in the library and then jump to the kernel. A good
example of this might be sigaction. A good one to experiment
with might read() -- try it with good and bad inputs and see
what comes back the registers, where errno is, etc.
-- Jeff
__________________________________________________
Jeff Denham (jdenham@allaire.com)
Allaire Corp: Resource-management software
for building and managing fast, reliable web sites
See us at http://www.allaire.com and http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
prev parent reply other threads:[~1999-08-02 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-31 4:00 Process unique number ? Jonathan Perret
1999-08-02 4:00 ` Jeff Denham [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox