* 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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user