summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/lib
Commit message (Collapse)AuthorAgeFilesLines
* * winlean.h: New file.Christopher Faylor2010-08-302-4/+3
| | | | | | | | | | | | | | | | * automode.c: Use "winlean.h". * binmode.c: Ditto. * gmon.c: Ditto. * textmode.c: Ditto. * textreadmode.c: Ditto. * winsup.h: Ditto. * lib/cygwin_attach_dll.c: Ditto. * lib/dll_main.cc: Ditto. * profile.c: Ditto. * crt0.c: Ditto. Cleanup ancient cruft. Add dummy calls to cygwin_premain*. * include/sys/cygwin.h: Remove old stuff. Move premain declarations nearer to other cygwin-specific function declarations. * globals.cc: Add comment.
* * Makefile.in (DLL_OFILES): Add pseudo-reloc.o.Christopher Faylor2010-05-073-369/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (child_info_fork::handle_fork): Call _pei386_runtime_relocator here. (dll_crt0_1): Ditto for non-fork case. * dll_init.cc (dll::init): Complain more in comment. Clean up slightly. (dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have a filled-in per_process structure. * globals.cc (__cygwin_user_data): Accommodate new fields for _pei386_runtime_relocator. * pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c. Include winsup.h directly. Collapse #ifdef __CYGWIN__ into one block. Perform minor whitespace code reformatting. (__report_error): Use small_printf to output error. (_pei386_runtime_relocator): Conditionalize for cygwin to take per_process pointer parameter. * winsup.h (_pei386_runtime_relocator): Declare. * include/cygwin/version.h (CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro. (CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro. (CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro. (CYGWIN_VERSION_API_MINOR): Bump to 227. * include/sys/cygwin.h: Remove obsolete comment. (per_process::unused2): Shorten. (per_process::pseudo_reloc_start): New field. (per_process::pseudo_reloc_end): Ditto. (per_process::image_base): Ditto. * lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for per_process structure. (_cygwin_crt0_common): Fill in pseudo_reloc runtime constants. * lib/pseudo-reloc-dummy.c: New file. Dummy function to satisify ld. * lib/pseudo-reloc.c: Delete.
* * lib/_cygwin_crt0_common.cc: Remove unneeded declarations.Christopher Faylor2010-04-201-3/+0
|
* Correct pseudo-reloc size bug wrt error messagesCharles Wilson2009-10-261-2/+3
|
* Sync pseudo-reloc.c with mingw64Charles Wilson2009-10-251-82/+76
|
* Support pseudo-reloc version 2Charles Wilson2009-10-071-14/+340
|
* * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to properChristopher Faylor2009-09-211-2/+3
| | | | | value. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward comment.
* * pipe.cc (fhandler_pipe::create_selectable): Add -pipe to default pipe names.Christopher Faylor2009-08-171-3/+3
| | | | | * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Use bool/true/false for what is actually a boolean variable.
* * cxx.cc (default_cygwin_cxx_malloc): Enhance commenting.Corinna Vinschen2009-08-131-7/+12
| | | | | | | | | * dll_init.cc (dll_dllcrt0_1): Likewise. * dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any cxx malloc overrides. * include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only install cxx malloc overrides when statically loaded. Extend comments.
* winsup/ChangeLog:Dave Korn2009-07-071-11/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.common (COMPILE_CXX): Add support for per-file overrides to exclude $(nostdinc) and $(nostdincxx) from compiler flags. (COMPILE_CC): Likewise for $(nostdinc). winsup/cygwin/ChangeLog: * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o (libstdcxx_wrapper_CFLAGS): Add flags for new module. (_cygwin_crt0_common_STDINCFLAGS): Define per-file override. (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise. * cxx.cc: Include "cygwin-cxx.h". (operator new): Tweak prototype for full standards compliance. (operator new[]): Likewise. (operator new (nothrow)): New fallback function. (operator new[] (nothrow), operator delete (nothrow), operator delete[] (nothrow)): Likewise. (default_cygwin_cxx_malloc): New struct of pointers to the above, for final last-resort fallback default. * cygwin-cxx.h: New file. (struct per_process_cxx_malloc): Define. (default_cygwin_cxx_malloc): Declare extern. * cygwin.din (__wrap__ZdaPv): Export new wrapper. (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv, __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj, __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj, __wrap__ZnwjRKSt9nothrow_t): Likewise. * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee' field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc. * libstdcxx_wrapper.cc: New file. (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv, __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj, __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj, __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++ malloc operators and their overrides. * winsup.h (default_cygwin_cxx_malloc): Declare extern. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward declare here. (struct per_process::forkee): Rename and repurpose from this ... (struct per_process::cxx_malloc): ... to this. * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h. (WEAK): Define shorthand helper macro. (__cygwin_cxx_malloc): Define and populate with weak references to whatever libstdc++ malloc operators will be visible at final link time for Cygwin apps and dlls. (_cygwin_crt0_common): Always look up cygwin DLL's internal per_process data, and don't test for (impossible) failure. Inherit any members of __cygwin_cxx_malloc that we don't have overrides for from the DLL's default and store the resulting overall set of overrides back into the DLL's global per_process data.
* Remove unneeded header files from source files throughout. Update copyrightsChristopher Faylor2009-01-034-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | where appropriate. * globals.cc: New file for generic global variables. * mkglobals_h: New file to generate globals.h. * mkstatic: New Script used to build a (currently non-working) static libcygwin_s.a. * Makefile.in: Add unused rule to build a non-working libcygwin_s.a. (DLL_OFILES): Add globals.o. Make all objects rely on globals.h. (globals.h): New target. Generate globals.h. * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator is allowed in _cygtls. * dcrt0.cc: Move most globals to globals.cc. * init.cc: Ditto. * environ.cc (strip_title_path): Remove now-unneeded extern. * fhandler_serial.cc (fhandler_serial::open): Ditto. * pinfo.cc: Ditto. (commune_process): Ditto. * shared.cc: Ditto. * glob.cc: Ditto. * strace.cc: Ditto. * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h. * path.cc (stat_suffixes): Move here. * security.h: Add forward class path_conv declaration. * smallprint.cc (__small_vsprintf): Make a true c++ function. (__small_sprintf): Ditto. (small_printf): Ditto. (console_printf): Ditto. (__small_vswprintf): Ditto. (__small_swprintf): Ditto. * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm. (hExeced): Move to globals.cc * strfuncs.cc (current_codepage): Ditto. (active_codepage): Ditto. * sync.cc (lock_process::locker): Move here from dcrt0.cc. * syscalls.cc (stat_suffixes): Move to path.cc. * tty.cc (tty::create_master): Uncapitalize fatal warning for consistency. * winsup.h: Include globals.h to declare most of the grab bag list of globals which were previously defined here. * mount.h: Move USER_* defines back to shared_info.h. * speclib: Force temporary directory cleanup.
* * mount.cc (mount_info::init): Add location where we're looking for fstab toChristopher Faylor2008-07-272-16/+6
| | | | | | | temporary message. * lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating accommodations for ancient cygwin DLLs. * lib/crt0.h: Include <windows.h> directly since it is needed.
* * lib/cygwin_attach_dll.c: Fix compiler warning.Christopher Faylor2007-08-022-0/+4
| | | | * lib/cygwin_crt0.c: Ditto.
* * Makefile.in (DLL_OFILES): Add winf.o.Christopher Faylor2006-04-121-1/+1
| | | | | | * spawn.cc: Move command line handling stuff into winf.cc. * winf.h: New file. * winf.cc: New file.
* * lib/libcmain.c (main): Properly deal with quoted first argument.Christopher Faylor2004-12-091-10/+19
|
* * lib/_cygwin_crt0_common.cc: Revert patch from 2004-09-16. BrakesCorinna Vinschen2004-09-271-0/+7
| | | | newly built DLLs.
* * cygwin.din (_impure_ptr): Don't export.Corinna Vinschen2004-09-161-7/+0
| | | | | | (reent_data): Export. * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop entirely. Don't initialize _impure_ptr or u->impure_ptr_ptr.
* * cygwin.din (_impure_ptr): Export.Christopher Faylor2004-09-161-1/+3
| | | | | | | | | (reent_data): Don't export. * dcrt0.cc (reent_data): Drop. (__cygwin_user_data): Initialize impure_ptr as GLOBAL_REENT. (_dll_crt0): Initialize _impure_ptr as GLOBAL_REENT. * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop. Declare extern as dllimport instead.
* * cygwin.din: Make crt0 functions NOSIGFE.Christopher Faylor2003-12-311-1/+0
| | | | | * include/cygwin/version.h: Gratuitous comment change. * lib/_cygwin_crt0_common.cc: Remove unneeded declaration.
* * Makefile.in (DLL_OFILES): Add getopt.o and iruserok.o.Corinna Vinschen2003-09-102-822/+0
| | | | | | | | | | | | | | | | * cygwin.din: Export __check_rhosts_file, __rcmd_errstr, optarg, opterr, optind, optopt, optreset, getopt, getopt_long, iruserok and ruserok. * getopt.c: Moved from lib to here. Define opt* variables as dllexport. * iruserok.c: Moved from lib to here. Rearrange function order. Prefer using 64/32 bit functions. * syscalls.cc (shell_fp): Define as struct __sFILE64. (getusershell): Use fopen64 instead of fopen. * winsup.h: Add declarations for seteuid32, fopen64, cygwin_gethostbyname and cygwin_inet_addr. * include/getopt.h: Declare opt* variables dllimport. * include/cygwin/version.h: Bump API minor number.
* * Makefile.in (DLL_OFILES): Add bsdlib.o.Corinna Vinschen2003-09-101-0/+319
| | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (RegisterServiceProcess): Add. * bsdlib.cc: New file. (daemon): New function. (login_tty): Ditto. (openpty): Ditto. (forkpty): Ditto. * cygwin.din: Export daemon, forkpty, login_tty, logwtmp, updwtmp, openpty and revoke. * syscalls.cc (updwtmp): New function, writing to wtmp exclusively. (logwtmp): Ditto. (login): Call updwtmp instead of writing to wtmp by itself. (logout): Ditto. * tty.cc (revoke): New funtion. * include/paths.h: Define _PATH_DEVNULL. * include/pty.h: New header. * include/cygwin/version.h: Bump API minor number. * include/sys/utmp.h: Declare logwtmp with const arguments. Declare updwtmp. * lib/iruserok.c: New file. (ruserok): New function. (iruserok): Ditto. (__ivaliduser): Ditto. (__icheckhost): Ditto.
* * lib/getopt.c: Refresh from NetBSD sources.Christopher Faylor2003-03-031-18/+28
|
* * lib/getopt.c: Nuke use of unneeded BSDisms.Christopher Faylor2003-03-021-8/+3
|
* * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT ↵Christopher Faylor2003-01-301-5/+2
| | | | behavior.
* * lib/pseudo-reloc.c: New file.Christopher Faylor2002-12-092-0/+49
| | | | | * lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during initialization of cygwin binary (.exe or .dll).
* * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.Christopher Faylor2002-06-241-21/+0
|
* * winsup.h: Remove alloca definition since it's now defined throughCorinna Vinschen2001-11-141-2/+1
| | | | | inclusion of stdlib.h. * lib/cygwin_crt0.c: Ditto.
* * lib/getopt.c (getopt_internal): Reset optind to 1 only if optresetCorinna Vinschen2001-11-071-1/+1
| | | | is not set.
* Eliminate excess whitespace.Christopher Faylor2001-11-052-7/+7
|
* * select.cc (peek_pipe): Only grab mutex when we actually got something fromChristopher Faylor2001-09-241-1/+6
| | | | the pipe.
* * lib/getopt.c (__progname): Don't declare if not compiling for cygwin.Christopher Faylor2001-09-191-2/+2
|
* * lib/getopt.c (getopt_long): Avoid compiler warning.Corinna Vinschen2001-09-191-1/+1
|
* * lib/getopt.c: Use __progname==__argv[0] when not compiling for cygwin.Christopher Faylor2001-09-191-0/+3
| | | | * scandir.cc (scandir): Use correct default when compar == NULL.
* * cygwin.din (__argv): Export.Christopher Faylor2001-09-191-297/+399
| | | | | | | (__argc): Ditto. (__progname): Ditto. * include/getopt.h (getopt_long): constify arguments. * lib/getopt.c: Import new file from NetBSD.
* Update copyrights.Christopher Faylor2001-09-116-6/+6
|
* * cygheap.cc (_cfree): Add regparm attribute.Christopher Faylor2001-05-081-6/+0
| | | | | | | | | | | | | | | | (_crealloc): Ditto. * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now. * dtable.cc (dtable::not_open): Move method. * dtable.h (dtable): Here. * exceptions.cc (ctrl_c_handler): Don't expect process group leader to handle a signal if it doesn't exist. * fhandler.h (fhandler_base): Make openflags protected. * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__. * path.cc (path_conv::check): Add some comments. Change strcat to assignment. * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate. * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary. * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
* * lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem to beChristopher Faylor2001-03-281-10/+8
| | | | | | | | | defined. Wrap definitions in extern "C". Include winsup.h to assure proper definitions. * dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that binmode.o, etc., will control default stdio settings. * dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force binmode/textmode settings. Default pipes to binmode.
* * dlopen.c (dlopen): Return NULL when name is NULL (suggested byChristopher Faylor2001-03-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chrisiasci@aol.com). * cygwin.din: Add a new, internally used export - _check_for_executable. * dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries. Pass user_data to premain functions. * fhandler.cc (fhandler_disk_file::open): Only check for executable if the linked program is intereested in the executable bit. (fhandler_disk_file::check_execable_p): Delete. * fhandler.h (executable_states): New enumeration of various states of executable bit caring. (fhandler_base::set_execable_p): New method. * fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal has been sent to the tty. Return -1 when this is so. * fhandler_console.cc (fhandler_console::read): Return -1 when signal sending character encountered. * path.cc (path_conv::check): Record when path refers to a disk device. Move executable extension check here. (check_sysfile): Accomodate new EXEC path states. (has_suffix): Remove. (next_suffix): Remove. (class suffix_scan): New clas. (suffix_scan::has): New method. (suffix_scan:next): New method. (symlink_info::check): Use suffix_scan method to control for scanning for suffixes. * path.h (path_conv::exec_state): New method. * perprocess.h: Make "C" friendly. * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC. Bump CYGWIN_VERSION_API_MINOR. * include/sys/cygwin.h: Change premain declarations. * winsup.h: Move __cplusplus test to after builtin defines.
* * pinfo.cc (codepage_init): Move function.Christopher Faylor2001-01-081-3/+3
| | | | | | | | | * environ.cc (codepage_init): To here. * exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it is supposed to be maskable. * signal.cc (sigaction): Ditto. * sigproc.cc (wait_sig): Ditto. * winsup.h: Eliminate global declaration of codepage_init.
* * path.cc (get_device_number): Allow /dev/ttySn to designate a com port.Christopher Faylor2000-11-131-1/+1
|
* Whitespace cleanup.Christopher Faylor2000-10-283-4/+4
| | | | | | * configure.in: Eliminate subdir stuff. * configure: Regenerate. * include/getopt.h (option): Make name field 'const'.
* * lib/_cygwin_crt0_common.cc: Add missing header files.Christopher Faylor2000-09-081-0/+2
|
* * include/cygwin/cygwin_dll.h: Update for modern compilers.Christopher Faylor2000-07-291-0/+2
| | | | | | | * lib/cygwin_crt0.c: Inexplicably need to define alloca for newer compilers. * fhandler.h (fhandler_console): Add new method. * fhandler.cc (fhandler_console::set_cursor_maybe): New method. (fhandler_console::read): Set cursor if it has moved to make it visible.
* Throughout, eliminate third argument to path_conv and use new PC_* constantsChristopher Faylor2000-07-172-1/+2
| | | | | | | | | | | | | | | | | | 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.
* * _cygwin_crt0_common.cc: Undef 'environ' or suffer compiler error.Christopher Faylor2000-07-171-0/+2
|
* * hinfo.cc (hinfo::linearize_fd_array): Make max_used_fd an int so that we canChristopher Faylor2000-07-152-13/+4
| | | | | | | | | | | | | | | | | | | | detect when there are no fds to pass. * dcrt0.cc (host_dependent_constants::init): Revert Sat Mar 18 01:32:04 2000 change. (dll_crt0_1): Set "cygwin_finished_initializing" flag. (dll_crt0): Don't perform memcpy if uptr is already set to internal structure. (_dll_crt0): Remember location of programs envptr. * dll_init.h (per_module, dll, dll_list): Revamp. * dll_init.cc: Revamp. Use new classes. * fork.cc (fork): Use new revamped dll, dll_list, and per_module stuff. * environ.cc: Use __cygwin_environ throughout rather than the user_data->envptr. * exec.cc: Ditto. * spawn.cc: Ditto. * winsup.h: Declare update_envptrs, cygwin_finished_initializing. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Revert previous change. * lib/cygwin_attach_dll.cc (cygwin_attach_dll): Always pass in own per_process structure or we end up overwriting information from the main program.
* * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset environ ifChristopher Faylor2000-07-121-1/+4
| | | | already set.
* * external.cc (cygwin_internal): Export __cygwin_user_data.Christopher Faylor2000-07-084-39/+74
| | | | | | | | | | | | | | * include/sys/cygwin.h: Allow definition of per_process even when not compiling with C++. (cygwin_getinfo_types): Add CW_USER_DATA. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Get __cygwin_user_data pointer from cygwin_internal. If it doesn't exist, return failure. Use either this pointer or passed in pointer throughout. Clear forkee. * lib/crt0.h: Accomodate argument changes to _cygwin_crt0_common. * lib/cygwin_attach_dll.c (cygwin_attach_dll): Reorganize to allow use of newer binaries with older DLLs. Detect older DLLs when _cygwin_crt0_common returns 0 and allocate space for a per_process structure on the stack. * lib/cygwin_crt0.c (cygwin_crt0): Ditto.
* * dcrt0.cc (__cygwin_user_data): Initialize.Christopher Faylor2000-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | (dll_crt0_1): Eliminate user_data initialization. (dll_crt0): Set up impure_ptr_ptr for older executables. (cygwin_dll_init): Eliminate user_data initializations. (__api_fatal): Don't check for user_data initialization. * dll_init.cc (struct dll): Store entire contents of per_process rather than just a pointer. (add): Ditto. (initOneDll): Don't check for user_data initialization. (DllList::recordDll): Store contents of per_process argument. (DllList::detachDll): Pass address of per_process field. (DllList::initAll): Ditto. (DllList::doGlobalDestructorsOfDlls): Ditto. (DllListIterator::operator *): Ditto. (dll_dllcrt0): Default to __cygwin_user_data if arg is NULL. * include/sys/cygwin.h: Reorganize per_process to eliminate obsolete fields and accomodate new way of initializing. * lib/_cygwin_crt0_common: Initialize _impure_ptr from __cygwin_user_data.impure_ptr.
* * dcrt0.cc (_dll_crt0): Renamed from dll_crt0 ().Christopher Faylor2000-07-011-2/+2
| | | | | | * winsup.h: Accomodate above change. * cygwin.din: Ditto. * lib/cygwin_crt0.c: Ditto.