mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 11:00:04 +08:00
5bc584ba65
for second argument. * path.h: Generalize SYMLINK_* constants to PC_*. (path_conv): Create a new method. Fold third argument into second. * dll_init.cc (dll_list::alloc): Try harder to find space to allocate dll struct. (dll_dllcrt0): Don't check sanity if we've already called dll_crt0. * path.cc (path_conv::check): Don't check for a null or empty path unless specifically told with a flag setting. (check_null_empty_path): New function, adapted from macro. * syscalls.cc (_rename): Use already-determined file attributes rather than checking again. * lib/cygwin/cygwin_attach.dll.c (cygwin_attach_dll): Use a static per_process structure since this is apparently supposed to be zeroed. * lib/cygwin_crt0.c (cygwin_crt0): Zero per_process structure sent to older DLLs.
33 lines
893 B
C
33 lines
893 B
C
/* cygwin_crt0.cc: crt0 for cygwin
|
|
|
|
Copyright 2000 Cygnus Solutions.
|
|
|
|
This file is part of Cygwin.
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
details. */
|
|
|
|
#undef __INSIDE_CYGWIN__
|
|
#include <windows.h>
|
|
#include <sys/cygwin.h>
|
|
#include "crt0.h"
|
|
|
|
extern void dll_crt0__FP11per_process (struct per_process *) __declspec (dllimport) __attribute ((noreturn));
|
|
|
|
/* for main module */
|
|
void
|
|
cygwin_crt0 (MainFunc f)
|
|
{
|
|
struct per_process *u;
|
|
if (_cygwin_crt0_common (f, NULL))
|
|
u = NULL; /* Newer DLL. Use DLL internal per_process. */
|
|
else /* Older DLL. Provide a per_process */
|
|
{
|
|
u = (struct per_process *) alloca (sizeof (*u));
|
|
memset (u, 0, sizeof (u));
|
|
(void) _cygwin_crt0_common (f, u);
|
|
}
|
|
dll_crt0__FP11per_process (u); /* Jump into the dll, never to return */
|
|
}
|