🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sgi.misc
2 messages
2 total messages Started by Fernando D. Mato Mira Fri, 10 Nov 1995 21:06
sproc man page bug?
#334
Author: Fernando D. Mato Mira
Date: Fri, 10 Nov 1995 21:06
27 lines
1252 bytes
The sproc man page says:

    int sproc (void (*entry) (void *), unsigned inh, ...);

     Type of optional third argument:
     void *arg;

and later

        If created via sproc the new process will be invoked as follows:

                    entry(void *arg)

But it doesn't say what happens if `arg' was not passed.

Is there a standard SGI trick to detect the presence of a single optional argument?
I guess what this means is that the new process is called with stack trash otherwise, right?

Thanks in advance,

-- 
Fernando D. Mato Mira			 http://ligwww.epfl.ch/matomira.html
Computer Graphics Lab                         	
Swiss Federal Institute of Technology (EPFL)  Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne			      FAX      : +41 (21) 693 - 5328
Switzerland				      E-mail   : matomira@di.epfl.ch
                                           
Re: sproc man page bug?
#335
Author: Dave Olson
Date: Sun, 12 Nov 1995 04:22
14 lines
1081 bytes
matomira@lig.di.epfl.ch (Fernando D. Mato Mira) writes:
| But it doesn't say what happens if `arg' was not passed.

You get whatever was was in register a2 when sproc() was called...

| Is there a standard SGI trick to detect the presence of a single optional argument?
| I guess what this means is that the new process is called with stack trash otherwise, right?

Not on the stack, just gets a value in a0 that gets ignored.
--

The most beautiful things in the world | Dave Olson, Silicon Graphics
are those from which all excess weight | http://reality.sgi.com/employees/olson
has been removed.  -Henry Ford         | olson@sgi.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads