From: Ted Dunning (ted@nmsu.edu)
Date: 03/20/92


From: ted@nmsu.edu (Ted Dunning)
Subject: Re: Pklite for Linux, end of project.
Date: 20 Mar 1992 19:18:27 GMT


In article <1992Mar19.150109.7380@athena.mit.edu> jyelon@suna0.cs.uiuc.edu (Josh Yelon) writes:

   Implementation would be trivial if only we had this one
   system call:

           execv_in_core(data, len, argv)
           char *data;
           int len;
           char *argv[];

   It acts exactly like execv, except that rather than exec'ing
   a file, it exec's a block of memory.

how about this? (i know it doesn't clean up the tmp directory).

void execv_in_core(char *data, int len, char *argv[])
{
        FILE *f;
        char *s;

        s = tmpnam("exec");
        f = fopen(s, "w");

        if (f && fwrite(data, len, 1, f) == 1) {
                execv(s, argv);
        }
        else {
                perror("execv_in_core");
                exit(1);
        }
}