summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/lib
Commit message (Collapse)AuthorAgeFilesLines
* Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen2016-06-2313-27/+0
| | | | | | | | | | | | | | Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove unused and unsafe call to __builtin_frame_addressPeter Foley2016-03-201-3/+2
| | | | | | | | | | | | | | | | initial_sp has been unused since commit fbf23e3 back in 2000. Keep the value, so as to avoid changing the offset of magic_biscuit. winsup/cygwin/lib/_cygwin_crt0_common.cc:140:52: error: calling 'void* __builtin_frame_address(unsigned int)' with a nonzero argument is unsafe [-Werror=frame-address] u->initial_sp = (char *) __builtin_frame_address (1); winsup/cygwin/ChangeLog lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize initial_sp with nullptr. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* * dcrt0.cc (cygwin_atexit): Change preceeding comment to reflectCorinna Vinschen2014-11-061-3/+18
| | | | | | | | | | API version numbers. * external.cc (cygwin_internal): disable setting cxx_malloc on 64 bit. Add CW_FIXED_ATEXIT case. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_FIXED_ATEXIT. * lib/atexit.c (atexit): Test running Cygwin version by checking return value of cygwin_internal (CW_FIXED_ATEXIT).
* * lib/atexit.c (atexit): Check for being linked into the executable.Corinna Vinschen2014-11-052-1/+24
| | | | | If so, call __cxa_atexit with NULL DSO handle. Explain why. * lib/dso_handle.c: New file providing fallback __dso_handle.
* * Makefile.in (NEW_FUNCTIONS): Add atexit to be not exported.Corinna Vinschen2014-11-051-0/+23
| | | | | | | | * lib/atexit.c (atexit): New, statically linkable version of atexit. * dcrt0.cc (cygwin_atexit): Add comment to mark this function as old entry point. Indiscriminately check for DSO of function pointer for all functions, if checking for DSO of return address fails on x86_64. Change comment accordingly.
* * include/sys/cygwin.h (struct per_process): Add posix_memalign. ReduceCorinna Vinschen2013-08-141-0/+1
| | | | | | | | | | size of unused2 accordingly. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize u->posix_memalign with address of posix_memalign. * malloc_wrapper.cc (posix_memalign): Call user-provided posix_memalign rather than just returning ENOSYS. * globals.cc (__cygwin_user_data): Initialize posix_memalign member.
* * lib/libcmain.c (main): Don't point to last quoted character if the only thingChristopher Faylor2013-07-191-2/+2
| | | | in the buffer is the program name.
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-237-19/+56
|
* Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor2013-01-215-5/+5
| | | | checkins. Regularize copyright format.
* * Makefile.common (CFLAGS_COMMON): Add temporary define to work around w32apiChristopher Faylor2012-07-301-1/+1
| | | | | | | | problem. * cygwin/winlean.h: Define constant which will be needed eventually. Remove hack in favor of another hack. * cygwin/lib/crt0.h: Use "winlean.h".
* * Makefile.in: Add some more optimization flags for cygwait, malloc and ↵Christopher Faylor2012-07-021-2/+1
| | | | | | | | | | | | | | | | | | | | | path. Explain why -fomit-frame-pointer doesn't work right for passwd.o and path.o. Add -static to link command line for cygwin0.dll. * fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly to silence compiler warning when compiling with -fstack-check. * net.cc (inet_ntop6): Initialize structure members to silence compiler warning when compiling with -fstack-check. * pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function. Detect NULL u. * winsup.h (_pei386_runtime_relocator): Declare this as extern "C". * lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with NULL argument. * signal.cc (sigaction_worker): Eliminate last argument. Let callers report their own strace info. Regparmize. (sigaction): Reflect sigaction_worker changes. (siginterrupt): Ditto. * exceptions.cc: Update copyright.
* Clean up whitespace.Christopher Faylor2011-12-171-2/+2
|
* * Throughout fix copyright dates.Corinna Vinschen2011-02-151-2/+2
|
* * cygheap.cc: Add some __stdcall decoration where appropriate.Christopher Faylor2011-02-101-1/+1
| | | | * lib/cygwin_crt0.c: __attribute -> __attribute__.
* * 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.