* Makefile.in (DLL_OFILES): Add hookapi.o. Eliminate some cruft.

* cygheap.h (cygheap_types): Add new enum: HEAP_1_HOOK.
(hook_chain): New struct.
(init_cygheap::hooks): Define new element.
* cygheap.cc (cygheap_fixup_in_child): Zero hook chain on exec.
* dcrt0.cc (dll_crt0_1): Call ld_preload just before calling main function.
* external.cc (cygwin_internal): Implement CW_HOOK.
* fork.cc (fork_child): Call fixup_hooks_after_fork.
* init.cc (cygwin_hmodule): Reinstate after a long absence.
* include/sys/cygwin.h: Define CW_HOOK.
* hookapi.cc: New file.
* select.cc (start_thread_socket): Add debugging output.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): gcc 4.x accommodation.
* fhandler_socket.cc (fhandler_socket::connect): Make sure that err is
initialized.
This commit is contained in:
Christopher Faylor
2005-03-22 19:00:31 +00:00
parent 7e3fd32b1c
commit b1d9a0bd41
13 changed files with 282 additions and 16 deletions

View File

@@ -28,6 +28,8 @@ details. */
#include "pwdgrp.h"
#include "cygtls.h"
void *hook_cygwin (const char *, const void *);
static external_pinfo *
fillout_pinfo (pid_t pid, int winpid)
{
@@ -298,6 +300,12 @@ cygwin_internal (cygwin_getinfo_types t, ...)
}
return p.binmode ();
}
case CW_HOOK:
{
const char *name = va_arg (arg, const char *);
const void *hookfn = va_arg (arg, const void *);
return (unsigned long) hook_cygwin (name, hookfn);
}
default:
return (DWORD) -1;
}