On Tuesday, 29 June 1999 at 14:44:39 +1000, Patryk Zadarnowski wrote:
>
>> I know about envp.
>>
>> What I want to know is the exact position of these variables on the stack.
>>
>> and if anywhere I can find some data, on the exact compisoition of the
>> stcak, then it will be very helpful.
>>
>> references of books and websites wil be most helpful.
>
> Basically, i386 BSD kernels (you're after i386, aren't you?) point ESP to
> the following "struct" (which means that it will be dumped at the very
> top of the address space)
>
>       struct kframe {
>           int   argc;         /* "argc" to be passed to main() */
>           char *argv[argc];   /* "argv" to be passed to main() */
>           char *null;         /* a NULL pointer terminating argv[] */
>           char **envp;        /* value to be assigned to "environ" */
>       };

In fact, the environment strings are at the very top, followed by the
arguments, followed by this structure.  But I suppose that's what you
meant to say.

Greg
--
See complete headers for address, home page and phone numbers
finger [EMAIL PROTECTED] for PGP public key


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to