* dcrt0.cc (get_cygwin_startup_info): New function pulled from dll_crt0_0.

(dll_crt0_0): Use get_cygwin_startup_info to retrieve cygwin-specific startup
pointer.
* external.cc (cygwin_internal): Implement CW_ARGV and CW_ENVP.
* include/sys/cygwin.h: Implement CW_ARGV and CW_ENVP.
This commit is contained in:
Christopher Faylor
2005-05-09 01:19:38 +00:00
parent 61931ed5dc
commit 1cd8ccec87
4 changed files with 77 additions and 48 deletions

View File

@@ -27,8 +27,10 @@ details. */
#include "heap.h"
#include "pwdgrp.h"
#include "cygtls.h"
#include "child_info.h"
void *hook_cygwin (const char *, const void *);
child_info *get_cygwin_startup_info ();
static external_pinfo *
fillout_pinfo (pid_t pid, int winpid)
@@ -306,6 +308,16 @@ cygwin_internal (cygwin_getinfo_types t, ...)
const void *hookfn = va_arg (arg, const void *);
return (unsigned long) hook_cygwin (name, hookfn);
}
case CW_ARGV:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
return (DWORD) (ci ? ci->moreinfo->argv : NULL);
}
case CW_ENVP:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
return (DWORD) (ci ? ci->moreinfo->envp : NULL);
}
default:
return (DWORD) -1;
}