summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/libc
Commit message (Collapse)AuthorAgeFilesLines
* Move getentropy/getrandom into own fileCorinna Vinschen2017-01-191-0/+70
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* login_tty: Rewrite following FreeBSD's tracesCorinna Vinschen2016-11-241-15/+8
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Include winsup.h prior to including other headersCorinna Vinschen2016-08-241-2/+5
| | | | | | Otherwise _GNU_SOURCE is not set when needed in sys/features.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement GNU extension strptime_lCorinna Vinschen2016-08-231-27/+47
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Only define __getreent inline function when building newlib or CygwinCorinna Vinschen2016-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commit 6f3943b erroneously removed the `#ifdef _COMPILING_NEWLIB' guarding the __getreent inline function. This patch ignored the fact that config.h is included when building applications, and the code in question requires internal, auto-generated headers to be available which are not exposed to user-space. Reinstantiate defined(_COMPILING_NEWLIB) test and alternatively check for defined (__INSIDE_CYGWIN__), otherwise we'd have to reinstantiate the __getreent macro in cygtls.h which is really confusing. While testing it turned out that a low number of source codes inside Cygwin won't see the inline __getreent due to a missing __INSIDE_CYGWIN__ definition. For malloc.cc this was actually deliberate to get different definitions from including cygmalloc.h. Change this by defining __INSIDE_CYGWIN__ in malloc.cc but changing the test in cygmalloc.h to test for defined(DLMALLOC_VERSION). This might need a change if we ever get around to replace dlmalloc with a newer, more threading-aware malloc implementation. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement strfmon_lCorinna Vinschen2016-08-151-35/+62
| | | | | | Use latest code from FreeBSD Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* POSIX-1.2008 per-thread locales, groundwork part 2Corinna Vinschen2016-08-151-2/+3
| | | | | | | | | Move all locale category structure definitions into setlocale.h and remove other headers in locale subdir. Create inline accessor functions for current category struct pointers and use throughout. Use pointers to "C" locale category structs by default in __global_locale. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
* Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen2016-06-235-10/+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>
* Throughout Cygwin, use u_intN_t or uintN_tCorinna Vinschen2016-03-248-33/+38
| | | | | | | | | | Don't use u_char, u_short, u_int or u_long in Cygwin, unless it refers to the Winsock types. Use u_intN_t in BSD-based sources, unsigned char where strings are concerned, uintN_t otherwise. Also: * net.cc: Fix comment, we're not using u_long anymore. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Change definition of b64_pton from K&R to ANSICorinna Vinschen2016-03-241-4/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use DnsFree instead of deprecated DnsRecordListFreePeter Foley2016-03-231-1/+1
| | | | | | | | | | | | | | | The latest version of the mingw headers have been updated to make DnsRecordListFree an alias of DnsFree when targeting Windows XP or later. Use DnsFree directly, avoiding the wrapper function. /home/peter/cross/src/cygwin/winsup/cygwin/libc/minires-os-if.c:289: undefined reference to `DnsFree' winsup/cygwin/ChangeLog autoload.cc: Load DnsFree rather then DnsRecordListFree libc/minires-os-if.cc (cygwin_query): Use DnsFree rather then DnsRecordListFree Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Move arc4random Cygwin only code to CygwinSebastian Huber2016-03-211-0/+24
| | | | | | Keep the Newlib arc4random.c identical to the OpenBSD upstream version. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
* Delete Cygwin's arc4random in favor of new Newlib implementationCorinna Vinschen2016-03-181-363/+0
| | | | | | | * Makefile.in (DLL_OFILES): Remove arc4random.o. * libc/arc4random.c: Remove file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Feature test macros overhaul: stdlib.hYaakov Selkowitz2016-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | Throughout, simplify the C99/C11 conditionals, and replace __STRICT_ANSI__ with the proper internal POSIX macros. The _*_r reentrant functions need not be guarded (and most haven't been) because such names in the global scope are reserved to the implementation. atoff is unique to newlib. dtoa is not actually exported (_dtoa_r is used internally), is nonstandard, and the declaration conflicts with the code included in MySQL, NSPR, and SpiderMonkey. mktemp was removed in POSIX.1-2001. The qsort_r declarations are reordered so that the GNU version retains precedence. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: fnmatch.hYaakov Selkowitz2016-03-171-0/+1
| | | | | | Use the proper internal macro for GNU extensions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Move fd_stuff from sys/types.h to sys/select.hCorinna Vinschen2015-12-071-0/+1
| | | | | | | | | | | | | | | | | | * libc/include/sys/types.h: Move definitions of NBBY and howmany to sys/param.h. Move definitions of select(2) macros to sys/select.h. * libc/include/sys/param.h: See above. * libc/include/sys/select.h: Move Cygwin's sys/select.h here. * include/sys/select.h: Move select(2) macros from newlib's sys/types.h here. Rename howmany to _howmany to unclutter namespace. Move file to newlib. * libc/rexex.cc: Add declaration for cygwin_gethostname. * poll.cc: Include sys/param.h and locale select.h. * select.h (cygwin_select): Declare. * uname.cc: Declare cygwin_gethostname. * winsup.h: Drop declarations of cygwin_select and cygwin_gethostname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update Cygwin's fnmatch to latest from FreeBSD.Corinna Vinschen2015-11-181-51/+81
| | | | | | | | * collate.h (__collate_load_error): Convert to extern declaration. * globals.cc (__collate_load_error): Define and initialize here. * libc/fnmatch.c: Update to latest from FreeBSD. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* copyright fixCorinna Vinschen2015-01-131-1/+1
|
* * minires-os-if.c (cygwin_query): Change questions into answers.Corinna Vinschen2015-01-121-0/+7
|
* * Throughout, use __try/__except/__endtry blocks, rather than myfaultCorinna Vinschen2014-08-222-93/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handler. * cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs has been moved from _local_storage to _cygtls. * cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage of counters. Change type of counters to uint32_t for clarity. Remove _cygtls as friend class. (struct _local_storage): Move pathbufs from here... (struct _cygtls): ...to here, allowing to access it from _sigbe. (class san): Only define on 32 bit. Remove errno, _c_cnt and _w_cnt members. (san::setup): Drop parameter. Don't initialize removed members. (san::leave): Don't set removed members. (class myfault): Only define on 32 bit. (myfault::faulted): Only keep implementation not taking any parameter. Drop argument in call to sebastian.setup. (__try/__leave/__except/__endtry): Implement to support real SEH. For now stick to SJLJ on 32 bit. * dcrt0.cc (dll_crt0_0): Drop 64 bit call to exception::install_myfault_handler. * exception.h (exception_handler): Define with EXCEPTION_DISPOSITION as return type. (PDISPATCHER_CONTEXT): Define as void * on 32 bit. Define as pointer to _DISPATCHER_CONTEXT on 64 bit. (class exception): Define separately for 32 and 64 bit. (exception::myfault): Add handler for myfault SEH handling on 64 bit. (exception::exception): Fix mangled method name to account for change in type of last parameter. (exception::install_myfault_handler): Remove. * exceptions.cc (exception::myfault_handle): Remove. (exception::myfault): New SEH handler for 64 bit. * gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when returning to the caller. * ntdll.h: Move a comment to a better place. (struct _SCOPE_TABLE): Define on 64 bit. * thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround. * tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs. (tls_pathbuf::destroy): Change type of loop variables to uint32_t. * tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to uint32_t. Accommodate new place of pathbufs. * tlsoffsets.h: Regenerate. * tlsoffsets64.h: Regenerate.
* * libc/minires.c (minires_dprintf): Change "Minires" to "Resolv" toCorinna Vinschen2014-07-071-2/+5
| | | | | | differ from external minres lib. (res_nquerydomain): Fix off-by-one in domain concatenation. Add debug output.
* * libc/rexec.cc (cygwin_rexec): Make ahostbuf static to avoid returningCorinna Vinschen2014-06-171-1/+1
| | | | an out-of-scope address.
* * libc/bsdlib.cc (forkpty): Close master and slave if fork fails toCorinna Vinschen2014-05-223-110/+76
| | | | | | | avoid resource leak (CID 59997). * libc/fts.c: Update to FreeBSD version 1.39 (CID 59947). * libc/minires.c (minires_get_search): Fix out-of-bounds read from words array (CID 59937).
* * localtime.cc: Define TM_GMTOFF and TM_ZONE based on __TM_GMTOFF andCorinna Vinschen2014-03-051-4/+15
| | | | | | | | | __TM_ZONE being defined. Throughout, write to these struct tm members only if CYGWIN_VERSION_CHECK_FOR_EXTRA_TM_MEMBERS is true. * libc/strptime.cc: Ditto. * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_EXTRA_TM_MEMBERS): Define. (CYGWIN_VERSION_API_MINOR): Bump to 272.
* Throughout, keep function definitions and declarations in sync withCorinna Vinschen2013-11-251-1/+2
| | | | newlib in terms of C99 "restrict" keyword.
* * Makefile.in (DLL_OFILES): Add arc4random.o.Corinna Vinschen2013-05-211-0/+363
| | | | | | | | | | | * common.din: Export arc4random, arc4random_addrandom, arc4random_buf, arc4random_stir and arc4random_uniform. * mktemp.cc (arc4random): Remove static replacement function. * posix.sgml (std-bsd): Add arc4random functions. * include/cygwin/stdlib.h: Declare arc4random functions. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * libc/arc4random.cc: New file implementing arc4random functions taken from FreeBSD.
* * libc/base64.c: New file.Corinna Vinschen2013-05-211-0/+316
| | | | | | | * Makefile.in (DLL_OFILES): Add base64.o. * common.din: Export __b64_ntop and __b64_pton. * posix.sgml (std-bsd): Add __b64_ntop and __b64_pton. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-239-31/+34
|
* Adapt to changes in newlib's sys/cdefs.h:Corinna Vinschen2013-04-221-1/+0
| | | | | | * include/sys/sysinfo.h (struct sysinfo): Rename __unused member to __f. * libc/fts.c (__FBSDID): Drop definition. * regex/regexec.c (__unused): Drop definition.
* Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor2013-01-213-3/+3
| | | | checkins. Regularize copyright format.
* * winlean.h: Make sure certain Windows macros are undefined again.Corinna Vinschen2012-07-121-1/+0
| | | | | | | | Add comment to explain why. * winsup.h: Include winlean.h from C sources as well. * libc/minires-os-if.c: Drop including ntdef.h. Fix previous ChangeLog entry.
* * fhandler_procnet.cc: Fix copyright.Corinna Vinschen2012-07-062-2/+2
| | | | | | * syslog.cc: Ditto. * libc/minires-os-if.c: Ditto. * libc/minires.h: Ditto.
* Add files missing in previous checkinCorinna Vinschen2012-07-061-7/+9
|
* In terms of network related functionality, rely on Winsock definitionsCorinna Vinschen2012-07-063-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as much as possible: * dtable.cc: Drop including sys/socket.h. * fhandler_procnet.cc: Change includes accordingly. * fhandler_socket.cc: Ditto. (fhandler_socket::listen): Avoid gcc error message initializing sin6. (LPFN_WSARECVMSG): Only define when building against w32api headers. * net.cc: Change includes accordingly. Define USE_SYS_TYPES_FD_SET and __WSA_ERR_MACROS_DEFINED. Define _INC_NETIOAPI temporarily and explain why. (struct _IP_ADAPTER_UNICAST_ADDRESS_LH): Only define when building against w32api headers. (struct _IP_ADAPTER_ADDRESSES_LH): Ditto. (SIO_GET_INTERFACE_LIST): Ditto. (ws_freeaddrinfo): Rename from freeaddrinfo so as not to collide with Winsock declaration. Change througout. (ws_getaddrinfo): Ditto. (ws_getnameinfo): Ditto. * select.cc: Include netdb.h after defining USE_SYS_TYPES_FD_SET. * syslog.cc: Drop including netinet/in.h. Define USE_SYS_TYPES_FD_SET and include ws2tcpip.h. * include/netdb.h (struct addrinfo): Don't define when building Cygwin. * include/cygwin/if.h: Don't declare if_xxx functions when building Cygwin. * include/cygwin/in.h: Disable most definitions when building Cygwin. * include/cygwin/socket.h: Disable sockaddr and sockaddr_storage definitions when building Cygwin. Same for MCAST_INCLUDE/MCAST_EXCLUDE. * libc/inet_addr.c: Don't define __INSIDE_CYGWIN__ nor __INSIDE_CYGWIN_NET__. * libc/inet_network.c: Ditto. * libc/minires.h: Drop redundant inclusion of netdb.h. Define __INSIDE_CYGWIN_NET__ only before including netdb.h and resolver headers.
* * libc/rcmd.cc: Don't undef __INSIDE_CYGWIN_NET__.Corinna Vinschen2012-07-061-0/+1
|
* Clean up whitespace.Christopher Faylor2011-12-175-30/+30
|
* * fhandler.h (__ptsname): New macro.Christopher Faylor2011-11-081-3/+12
| | | | | | | | * dtable.cc (decode_tty): Use __ptsname to generate the slave pty name. * fhandler_tty.cc (fhandler_pty_master::ptsname_r): Ditto. * bsdlib.cc: Add needed includes for openpty() changes. (openpty): Use __ptsname to generate the slave pty name. Close slave fd when aslave == NULL.
* Based on newlib patch to strptime by Peter Rosin <peda@lysator.liu.se>:Corinna Vinschen2011-05-121-0/+92
| | | | | | | | * libc/time/strptime.c (is_leap_year): New static function. (first_day): Ditto. (__strptime): Fill in tm_yday when all of tm_year, tm_mon and tm_mday are updated. Fill in tm_mon, tm_mday and tm_wday when both of tm_year and tm_yday are updated.
* * libc/minires-os-if.c (get_dns_info): Drop printing uninitializedCorinna Vinschen2011-05-061-1/+1
| | | | value of dwRetVal in debug output.
* * libc/minires-os-if.c (get_dns_info): Remove unnecessary test forCorinna Vinschen2011-05-011-2/+1
| | | | existence of DnsQuery_A.
* * Makefile.in (DLL_IMPORTS): Drop advapi32.dll.Corinna Vinschen2011-04-191-36/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc: Enable autoloading advapi32 functions. * environ.cc (regopt): Use wide char arguments in reg_key functions. * fhandler_console.cc (beep): Ditto. Use WCHAR throughout. * registry.cc (reg_key): Rewrite reg_key class to use native NT registry functions. Use WCHAR string parameters throughout. Use PCWSTR rather than const WCHAR. Drop multibyte char functionality. Drop unused methods. (get_registry_hive_path): Use RtlQueryRegistryValues to fetch path from registry. (load_registry_hive): Drop useless check for user hive being available. Load hive using NtLoadKey. * registry.h: Accommodate above changes. * sched.cc (sched_rr_get_interval): Use wide char arguments in reg_key functions. * shared.cc (init_installation_root): Ditto. (shared_info::init_obcaseinsensitive): Use RtlQueryRegistryValues to fetch obcaseinsensitive value. (shared_info::heap_slop_size): Use wide char arguments in reg_key functions. (shared_info::heap_chunk_size): Ditto. * syscalls.cc (gethostid): Ditto. * winsup.h (__WIDE): Define. (_WIDE): Define. * libc/minires-os-if.c (get_registry_dns_items): Don't fetch values from registry. Just extract them from given UNICODE_STRING parameter. (get_registry_dns): Fetch all registry values at once using RtlQueryRegistryValues.
* * libc/strptime.c: Remove misleading comment.Corinna Vinschen2011-04-011-4/+0
|
* * libc/bsdlib.cc: Include err.h.Corinna Vinschen2011-02-021-0/+1
|
* * autoload.cc (std_dll_init): Move dll_path closer to its use. Use dll_path inChristopher Faylor2010-09-241-2/+2
| | | | | | fatal error. Set ret values under lock control. * lib/minires.c (res_nsend): Fix compilation errors owing to pointer signedness.
* 2010-09-21 Pierre Humblet <Pierre.Humblet@ieee.org>Pierre Humblet2010-09-211-4/+22
| | | | | | * libc/minires.c (res_nsend): Use the Windows resolver if appropriate. (dn_expand): Only set errno in case of error. Delete old comments. (dn_skipname): Fix typo in comment.
* * net.cc: Remove calls to sig_dispatch_pending throughout.Corinna Vinschen2010-03-301-1/+0
| | | | * libc/rexec.cc: Ditto.
* * libc/rcmd.c: Enable IPv6.Corinna Vinschen2010-03-291-6/+0
|
* * libc/strptime.cc: Implement support for era, alt_digits and POSIXCorinna Vinschen2010-02-261-47/+402
| | | | | | | | | | | | | | | | | | | | padding and width modifiers. (era_info_t): New type. (free_era_info): New static function to free era_info_t storage. (get_era_info): New static function to create era_info_t storage from LC_TIME era information. (alt_digits_t): New type. (get_alt_digits): New static function to create alt_digits_t storage from LC_TIME alt_digits information. (free_alt_digits): New static function to free alt_digits_t storage. (find_alt_digits): New static function to scan input for alternative digits and return them, if any. Return NULL otherwise. (__strptime): New static function taking all code from strptime. Implement handling for E, O, +, 0, and width modifiers per POSIX-1.2008. (strptime): Convert into wrapper function to provide era_info and alt_digits pointers and call __strptime. (conv_num): Take additional alt_digits_t parameter and if it's not NULL, call find_alt_digits to convert.
* * libc/strfmon.c (__setup_vars): Test for an empty string rather thanCorinna Vinschen2010-01-291-2/+2
| | | | for a NULL pointer.
* * libc/strfmon.c (__setup_vars): Fix compiler warning about assigning constChristopher Faylor2010-01-291-2/+3
| | | | | | strings. Compare a pointer to NULL rather than '\0'. * dll_init.cc (dll_dllcrt0_1): Minor comment fix. * pipe.cc (fhandler_pipe::create_selectable): Remove Win9x accommodation.