comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: idl process id
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: idl process id [message #11532] Thu, 23 April 1998 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
>> IDL> result=call_external('/lib/libc.so.1.9','getpid')

> Does anyone know how to get this to work on a DEC alpha?
> I can't find a shared object version of libc in my /lib
> directory.

Look in /shlib instead:

IDL> result=call_external('/shlib/libc.so','getpid')
IDL> print,result
31185

With the easy-going way of adding new system routines that I found
two days ago, just compile the below included C-code into a
shareable object file (remember to link in $IDL_DIR/bin/bin.alpha),
initialize with

IDL> print,call_external('gmain.so','addmain')

and then you go:

IDL> print,getpid()

(This is perhaps not a good example of this utility - since it's
possible to do this with a single-line call_external statement,
but it does illustrate how easy it is to expand IDL by adding
"built-in" routines that are able to return honest-to-RSI *variables*).

Regards,

Stein Vidar

-----------------------------------------------------gmain.c

#include <unistd.h>
#include <stdio.h>
#include "export.h"

#define NULL_VPTR ((IDL_VPTR) NULL)

IDL_VPTR GETPID(int argc, IDL_VPTR argv[])
{
IDL_VPTR tmp = IDL_Gettmp();

if (tmp==NULL_VPTR) {
IDL_Message(IDL_M_NAMED_GENERIC,IDL_MSG_LONGJMP,
"Couldn't create temporary variable");
}

tmp->type = IDL_TYP_LONG;
tmp->value.l = getpid();

return tmp;
}

IDL_SYSFUN_DEF main_def[] = {{(IDL_FUN_RET) GETPID,"GETPID", 0, 0}};

IDL_LONG addmain(int argc,char *argv[])
{
IDL_AddSystemRoutine(main_def,IDL_TRUE,1); /* Just add getpid */
return 0;
}
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: object creation question
Next Topic: Re: Question. CW_PDMENU

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:28:34 PDT 2025

Total time taken to generate the page: 0.00374 seconds