From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,752ea49178f8ced9 X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: Process unique number ? Date: 1999/08/02 Message-ID: <37A5A782.1AE078F1@allaire.com>#1/1 X-Deja-AN: 507962935 Content-Transfer-Encoding: 7bit References: <37A2DC56.64C1BC99@cybercable.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 933603329 207.86.119.34 (Mon, 02 Aug 1999 10:15:29 EDT) Organization: Allaire Corporation MIME-Version: 1.0 NNTP-Posting-Date: Mon, 02 Aug 1999 10:15:29 EDT Newsgroups: comp.unix.osf.osf1 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