On 2003.08.09, Jim Wilcoxson <[EMAIL PROTECTED]> wrote:
>
> This seems like a lot of overhead, and we'd have to do it on every
> request.
>
> Any ideas?

If you really need this information, perhaps its worth writing a very
thin shared object that defines some tcl proc (getpid) and returns what
the system's getpid() syscall gives you.

== start: getpidCmd.c ==

#include <sys/types.h>
#include <unistd.h>
#include <tcl.h>

int
GetpidObjCmd(ClientData clientData, Tcl_Interp *interp,
    int objc, Tcl_Obj *CONST objv[])
{
    Tcl_SetObjResult(interp, Tcl_NewIntObj(getpid()));
    return TCL_OK;
}

int
Getpid_Init(Tcl_Interp *interp)
{
    Tcl_CreateObjCommand(interp, "sys.getpid", GetpidObjCmd, NULL, NULL);
    return TCL_OK;
}

== stop: getpidCmd.c ==

$ gcc -shared -o getpid.so -I/usr/include/tcl8.4 getpidCmd.c

<%
    load getpid.so
    ns_adp_puts [sys.getpid]
%>


WARNING:  This is mostly untested I just wrote into this email.  On my
Linux machine it compiles and runs just fine.  It should at least get
you 99% of the way to your solution.

-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to