Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Process unique number ?
@ 1999-07-31  4:00 Jonathan Perret
  1999-08-02  4:00 ` Jeff Denham
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Perret @ 1999-07-31  4:00 UTC (permalink / raw)


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 ?

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.

Thanks in advance,
--Jonathan



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Process unique number ?
  1999-07-31  4:00 Process unique number ? Jonathan Perret
@ 1999-08-02  4:00 ` Jeff Denham
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Denham @ 1999-08-02  4:00 UTC (permalink / raw)


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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-08-02  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-31  4:00 Process unique number ? Jonathan Perret
1999-08-02  4:00 ` Jeff Denham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox