* child_info.h (child_info_spawn::__stdin): New element.

(child_info_spawn::__stdin): Ditto.
(CURR_CHILD_INFO_MAGIC): Regenerate.
* dcrt0.cc (check_sanity_and_sync): Minor cleanup.
(child_info_spawn::handle_spawn): Handle new __std* elements by calling
move_fd.
* dtable.cc (dtable::move_fd): Define new function.
* dtable.h (dtable::move_fd): Declare new function.
* fhandler.h (fhandler_pipe::popen_pid): Declare new element.
* fhandler.h (fhandler_pipe::get_popen_pid): Define new function.
* fhandler.h (fhandler_pipe::set_popen_pid): Ditto.
* pipe.cc (fhandler_pipe::fhandler_pipe): Zero popen_pid.
(fhandler_pipe::dup): Ditto.
* spawn.cc (handle): Change second argument to bool.
(spawn_guts): Accept __stdin/__stdout arguments and set them appropriately in
child_info structure and in STARTUPINFO structure.
* syscalls.cc (popen): New cygwin-specific implementation using spawn.
(pclose): Ditto.
* winsup.h (spawn_guts): Accommodate new arguments for spawn_guts.
* fhandler.cc (fhandler_base::set_no_inheritance): Make second arg a bool.
* fhandler.h (fhandler_base::set_no_inheritance): Ditto for declaration.
* child_info.h (child_info::msv_count): Rename from the now-inappropriate
"zero".
(child_info_spawn::filler): Add filler to work around Vista bug.
(child_info_fork::filler): Ditto.
* dcrt0.cc (get_cygwin_startup_info): Remove "zero" check since it is now
always filled out.
* fork.cc (frok::parent): Move ch.zero manipulation to constructor.
* spawn.cc (spawn_guts): Ditto.  Remove _ch wrapper.
* sigproc.cc (child_info::child_info): Initialize starter[].
* shared.cc (shared_info::heap_slop_size): Remove noisy system_printfs.
* shared_info.h (CURR_SHARED_MAGIC): Regenerate.
This commit is contained in:
Christopher Faylor
2006-12-11 18:55:29 +00:00
parent e79c01f84e
commit c16548b2a2
15 changed files with 251 additions and 121 deletions

View File

@ -167,7 +167,7 @@ class fhandler_base
void set_flags (int x, int supplied_bin = 0);
bool is_nonblocking ();
void set_nonblocking (int yes);
void set_nonblocking (int);
bool wbinary () const { return status.wbinset ? status.wbinary : 1; }
bool rbinary () const { return status.rbinset ? status.rbinary : 1; }
@ -249,15 +249,15 @@ class fhandler_base
virtual char *get_proc_fd_name (char *buf);
virtual void hclose (HANDLE h) {CloseHandle (h);}
virtual void set_no_inheritance (HANDLE &h, int not_inheriting);
virtual void set_no_inheritance (HANDLE &, bool);
/* fixup fd possibly non-inherited handles after fork */
bool fork_fixup (HANDLE parent, HANDLE &h, const char *name);
bool fork_fixup (HANDLE, HANDLE &, const char *);
virtual bool need_fixup_before () const {return false;}
int open_9x (int flags, mode_t mode = 0);
virtual int open (int flags, mode_t mode = 0);
int open_fs (int flags, mode_t mode = 0);
int open_9x (int, mode_t = 0);
virtual int open (int, mode_t = 0);
int open_fs (int, mode_t = 0);
virtual int close ();
int close_fs ();
virtual int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2)));
@ -520,8 +520,12 @@ protected:
HANDLE writepipe_exists;
DWORD orig_pid;
unsigned id;
private:
pid_t popen_pid;
public:
fhandler_pipe ();
void set_popen_pid (pid_t pid) {popen_pid = pid;}
pid_t get_popen_pid () const {return popen_pid;}
_off64_t lseek (_off64_t offset, int whence);
select_record *select_read (select_record *s);
select_record *select_write (select_record *s);