Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-14Cygwin: rand(3): implement in terms of random(3)Corinna Vinschen
This makes rand(3) ISO C compliant and adds locking to avoid race conditions. Reported-by: Bruno Haible <bruno@clisp.org> Fixes: 8a0efa53e4491 ("import newlib-2000-02-17 snapshot") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-13Cygwin: random: drop unused function srandomdev()Corinna Vinschen
Also drop includes only required for srandomdev(). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-11-13Cygwin: random: make random(3) functions thread-safeCorinna Vinschen
Add locking to the random(3) family of functions to gain thread-safety per POSIX. Use NetBSD version of the file as role-model. Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-12-07Cygwin: add missing pragmaCorinna Vinschen
Add missing "#pragma GCC diagnostic push" to the pragma bracket guarding the srandom call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-17Cygwin: fix build with GCC 7Yaakov Selkowitz
GCC 7 is able to see straight through this trick, so use a more formal method to avoid the warning. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-08-20Only define __getreent inline function when building newlib or CygwinCorinna Vinschen
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>
2016-03-29Fix Cygwin setstate definitionCorinna Vinschen
setstate is supposed to take a char *, not a const char *. * random.cc (setstate): Unconstify parameter to align to stdlib.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-21srandom: Replace accessing /dev/random by equivalent getentropy callCorinna Vinschen
/dev/random calls getentropy. So there's no good reason to go out of our way to open /dev/random just to call getentropy anyway. * random.cc (srandomdev): Drop opening /dev/random in favor of calling getentropy. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2008-09-11* cygheap.cc (creturn): Reorganize to avoid a new compiler warning/error.Christopher Faylor
* dtable.cc (handle_to_fn): Ditto. * fhandler_console.cc (fhandler_console::read): Ditto. (fhandler_console::scroll_screen): Ditto. (dev_console::set_color): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::read): Ditto. * fhandler_tape.cc (mtinfo_drive::get_status): Ditto. * hookapi.cc (find_first_notloaded_dll): Ditto. * mmap.cc (msync): Ditto. * pipe.cc (pipesync::pipesync): Ditto. * sec_acl.cc (getace): Ditto. * sec_auth.cc (create_token): Ditto. (lsaauth): Ditto. * select.cc (peek_pipe): Ditto. * spawn.cc (av::fixup): Ditto. * syscalls.cc (popen): Ditto. * tty.cc (tty::init_session): Ditto. * uinfo.cc (pwdgrp::load): Ditto. * fhandler.cc (fhandler_base::setup_overlapped): Ditto. (fhandler_base::wait_overlapped): Rename second use of res variable to wres or errors are not returned correctly. * dcrt0.cc: Remove obsolete variable. * dll_init.cc (release_upto): Fix typo involving incorrect use of '|'. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a compiler warning regarding coercing type-punned variables. (fhandler_base::fstat_by_name): Ditto. fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo. (fhandler_fifo::wait): Add all conditions to switch statement to avoid a compiler warning. * fhandler_process.cc: Avoid unneeded initialization of variables to zero. (fhandler_socket::listen): Add braces around initializer. * flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a compiler warning. Fix problem with EWOULDBLOCK error return. * path.cc (GUID_shortcut): Use braces around struct initializer. (cygwin_conv_path): Reorganize to avoid a compiler warning. * random.cc (dummy): Mark variable as volatile to avoid a "used uninitialized" warning. * libc/getopt.c: Mark some variables as dllexport although gcc doesn't seem to do the right thing with them. * libc/minires-os-if.c (get_registry_dns_items): Coerce some function arguments to avoid a compiler warning.
2008-05-13 * random.cc (initstate): Align to POSIX definition.Corinna Vinschen
(setstate): Ditto.
2008-04-07Remove unneeded header files from source files throughout.Christopher Faylor
2007-07-08* Makefile.in (DLL_OFILES): Add newly-imported random.o. Eliminate reliance onChristopher Faylor
libiberty. * random.cc: Import from FreeBSD. Modify for Cygwin environment. * include/cygwin/stdlib.h (random): Reflect change in return value to be more linux/freebsd-like. (srandom): Ditto.
2007-07-08Add initial FreeBSD version of random.cChristopher Faylor