summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove misleading indentationPeter Foley2016-03-212-3/+6
| | | | | | | | | | | GCC 6.0+ warns on misleading indentation, so fix it. winsup/cygserver/ChangeLog * sysv_msg.cc (msgsnd): Fix misleading indentation. * sysv_msg.cc (msgrcv): Ditto. * sysv_sem.cc (semop): Ditto. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Move arc4random Cygwin only code to CygwinSebastian Huber2016-03-213-15/+25
| | | | | | Keep the Newlib arc4random.c identical to the OpenBSD upstream version. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
* srandom: Replace accessing /dev/random by equivalent getentropy callCorinna Vinschen2016-03-201-10/+1
| | | | | | | | | | /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>
* Revert "Use high-resolution timebases for select()."Corinna Vinschen2016-03-203-141/+70
| | | | | | This reverts commit 6e70fd315a29578f090a98f84e9d8e95ddb156e3. Revert accidental push
* Revert "Debug printfs."Corinna Vinschen2016-03-203-21/+2
| | | | | | This reverts commit 9f82de59a07da145c177648fe474f19cd9def7a1. Revert accidental push
* Revert "Improve and simplify select()."Corinna Vinschen2016-03-203-15/+76
| | | | | | This reverts commit 472d0a228c56bd4783ebb0561667cda2de3cd168. Revert accidental push
* Drop redundant arc4random prototypes from cygwin/stdlib.hCorinna Vinschen2016-03-201-6/+0
| | | | | | | | | Newlib's default stdlib.h now defines these functions so we can drop them from the Cygwin-specific header. Remove the arc4random_stir and arc4random_uniform prototypes entirely. They shouldn't be used by applications anymore. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Allow machine-dependent arc4 lockingCorinna Vinschen2016-03-202-18/+35
| | | | | | | | | | | | newlib: * libc/stdlib/arc4random.h: Remove Cygwin-specific locking code. Conditionalize arc4 locking. Check for _ARC4_LOCK_INIT being undefined to fall back to default implementation. cygwin: * include/machine/_arc4random.h: New file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Improve and simplify select().John Hood2016-03-203-76/+15
| | | | | | | | | | * cygwait.h (cygwait_us) Remove; this reverts previous changes. * select.h: Eliminate redundant select_stuff::select_loop state. * select.cc (select): Eliminate redundant select_stuff::select_loop state. Eliminate redundant code for zero timeout. Do not return early on early timer return. (select_stuff::wait): Eliminate redundant select_stuff::select_loop state.
* Debug printfs.John Hood2016-03-203-2/+21
| | | | | | | * fhandler.cc (fhandler_base::get_readahead): Add debug code. * fhandler_console.cc (fhandler_console::read): Add debug code. * select.cc (pselect): Add debug code. (peek_console): Add debug code.
* Use high-resolution timebases for select().John Hood2016-03-203-70/+141
| | | | | | | | | | | | * cygwait.h: Add cygwait_us() methods. * select.h: Change prototype for select_stuff::wait() for larger microsecond timeouts. * select.cc (pselect): Convert from old cygwin_select(). Implement microsecond timeouts. (cygwin_select): Rewrite as a wrapper on pselect(). (select): Implement microsecond timeouts. (select_stuff::wait): Implement microsecond timeouts with a timer object.
* * winsup/testsuite/configure: chmod a+xJohn Hood2016-03-201-0/+0
|
* Move get_nonascii_key into fhandler_console.John Hood2016-03-203-5/+3
| | | | | | | * fhandler.h (fhandler_console): Move get_nonascii_key() from select.c into this class. * select.cc (peek_console): Move get_nonascii_key() into fhandler_console class.
* respect datarootdirPeter Foley2016-03-201-0/+1
| | | | | | | | | | Recent versions of autoconf define datadir/infodir in terms of datarootdir. Add it. winsup/ChangeLog * Makefile.in: define datarootdir Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Fix strict aliasingPeter Foley2016-03-201-2/+1
| | | | | | | | | Fix a strict aliasing error detected by gcc 6.0+ winsup/cygwin/ChangeLog * pinfo.cc (winpids::enum_process): Fix strict aliasing. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Fix typoed comparisonPeter Foley2016-03-201-1/+1
| | | | | | | winsup/cygwin/ChangeLog * thread.cc (semaphore::open): Fix mistaken conditional. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* The address of an class always evaluates to truePeter Foley2016-03-201-1/+1
| | | | | | | | | | winsup/cygwin/pinfo.cc:465:14: error: the compiler can assume that the address of 'tc' will always evaluate to 'true' [-Werror=address] winsup/cygwin/ChangeLog * pinfo.cc (_pinfo::set_ctty): remove always true check. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Remove misleading indentationPeter Foley2016-03-201-1/+1
| | | | | | * syscalls.cc (getpriority): Fix misleading indentation. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Add necessary braces to if statementsPeter Foley2016-03-202-2/+4
| | | | | | | | | | | The missing braces cause only the first expression to be guarded by the else clause. winsup/cygwin/ChangeLog * fhandler_disk_file.cc (facl): Add missing braces to if statement. * mount.cc (dos_drive_mappings): Add missing braces to if statement. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* Remove dead code from fhandler_console.Peter Foley2016-03-201-2/+0
| | | | | | | | | | | | | | | | | This if is unconditionally false, so remove it. winsup/cygwin/fhandler_console.cc: In member function 'bool dev_console::fillin(HANDLE)': winsup/cygwin/fhandler_console.cc:740:22: error: self-comparison always evaluates to false [-Werror=tautological-compare] if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X) ~~~~~~~~~~~^~~~~~~~~~~~~ winsup/cygwin/fhandler_console.cc:740:50: error: self-comparison always evaluates to false [-Werror=tautological-compare] if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X) ~~~~~~~~~~~^~~~~~~~~~~~~ winsup/cygwin/ChangeLog * fhandle_console.cc (fillin): remove dead code Signed-off-by: Peter Foley <pefoley2@pefoley.com>
* 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>
* winsup: Move all old CVS Changelogs into CVSChangeLogs.old dirCorinna Vinschen2016-03-1939-7/+0
|
* Remove ill-advised cygwin_propsCorinna Vinschen2016-03-195-215/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cygwin_props have been invented to allow switching off the unique installation keys in the first place, supposedly for debugging. This never really was a good idea, after all we *want* the installations to be independent and there's no good reason to break that, not even for debugging purposes. Other than that, cygwin_props were meant to be used for some other global settings which never took place. There's just no good reason to tweak the DLL binary invisibly where a setting could be done in a file or the environment. This patch removes the cygwin_props entirely, including the related settings in cygcheck. cygwin: * cygprops.h: Remove file. * globals.cc (cygwin_props): Remove. * cygheap.cc (init_cygheap::init_installation_root): Drop removing installation key. utils: * cygcheck.cc: Drop including cygprops.h. Remove now unused option values. (unique_object_name_opt): Remove. (handle_unique_object_name): Remove function. (usage): Remove text for unique-object-names options. (longopts): Remove unique-object-names options. (main): Drop handling unique-object-names options. doc: * utils.xml (cygcheck): Remove text for unique-object-names options. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate configure script.Jeff Johnston2016-03-191-8/+9281
|
* Remove references to older Cygwin releases from documentationCorinna Vinschen2016-03-1815-166/+107
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* sparc64: move struct timeval to <sys/_timeval.h>Yaakov Selkowitz2016-03-181-1/+6
| | | | | | | | | | | commit bb0159489785d577ad0b8061a1ba7956ee0f89d0 moved the struct timeval declaration from <sys/time.h> to <sys/_timeval.h>, and commit 01885f533de81ff73e9da1519a4b5f2316b49f86 changed <sys/select.h> to include <sys/_timeval.h>. Therefore, sparc64's own struct timeval needs to be moved accordingly in order to avoid a conflict from the generic type. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
* Feature test macros overhaul: sparc64Yaakov Selkowitz2016-03-182-15/+16
| | | | | | | | | | | | sparc64 has a number of its own headers which override the generic ones. These too need to use feature test macros properly. These changes correspond to the generic fcntl.h and sys/stat.h changes in commit d2df6d381b36f3f76420bc3bab965fbbdc3c3a8c and commit 069e400c913659432c5d1953c4fa9a696b06e340. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
* Cleanup macros in chacha_private.h to be target-type independentHowland, Craig D2016-03-181-5/+2
| | | | | * libc/stdlib/chacha_private.h (U8C, U32C): Remove un-necessary macros. (U8V, U32V): Drop masking.
* Only export arc4random_stir and arc4random_addrandom on CygwinCorinna Vinschen2016-03-181-8/+5
| | | | | | | Export to maintain backward compatibility, but don't let them do anything useful. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Feature test macros overhaul: signal.h (part 2)Yaakov Selkowitz2016-03-181-16/+12
| | | | | | | | | | | Move the sig*set macros following the functions inside their feature test macro conditional. This fixes the build on bare-metal targets following commit 5c78499ae2ae6ac28854b43a1ad73d917b40c62d. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
* arm: fix build with newlib supplied syscalls enabledYaakov Selkowitz2016-03-182-2/+2
| | | | | | | | | In file included from libc/sys/arm/crt0.S:2:0: libc/sys/arm/arm.h:32:25: fatal error: acle-compat.h: No such file or directory acle-compat.h is libc/machine/arm. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Implement getentropy for CygwinCorinna Vinschen2016-03-185-30/+27
| | | | | | | | | | | | | | * miscfuncs.cc (getentropy): Move fhandler_dev_random::crypt_gen_random here and rename to getentropy. Fix type and return values to match getentropy requirements. * miscfuncs.h (getentropy): Add prototype. * fhandler.h (fhandler_dev_random::crypt_gen_random): Remove prototype. * fhandler_random.cc (fhandler_dev_random::crypt_gen_random): Drop. (fhandler_dev_random::write): Use getentropy instead. (fhandler_dev_random::read): Ditto. * fhandler_socket.cc (fhandler_socket::af_local_set_secret): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Delete Cygwin's arc4random in favor of new Newlib implementationCorinna Vinschen2016-03-182-364/+0
| | | | | | | * Makefile.in (DLL_OFILES): Remove arc4random.o. * libc/arc4random.c: Remove file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Arc4random locking: Check for threaded application on CygwinCorinna Vinschen2016-03-181-0/+19
| | | | | | | libc/stdlib/arc4random.h (_ARC4_LOCK): Special case Cygwin. (_ARC4_UNLOCK): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add arc4random_stir and arc4random_addrandom for OpenBSD compatibilityCorinna Vinschen2016-03-181-0/+18
| | | | | | | * libc/stdlib/arc4random.c (arc4random_stir): New function. (arc4random_addrandom): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add arc4random() etc. from OpenBSD 5.8Sebastian Huber2016-03-1810-7/+626
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to the OpenBSD man page, "A Replacement Call for Random". It offers high quality random numbers derived from input data obtained by the OpenBSD specific getentropy() system call which is declared in <unistd.h> and must be implemented for each Newlib port externally. The arc4random() functions are used for example in LibreSSL and OpenSSH. Cygwin provides currently its own implementation of the arc4random family. Maybe it makes sense to use this getentropy() implementation: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/crypto/getentropy_win.c?rev=1.4&content-type=text/x-cvsweb-markup * libc/include/stdlib.h (arc4random): Declare if __BSD_VISIBLE. (arc4random_buf): Likewise. (arc4random_uniform): Likewise. * libc/include/sys/unistd.h (getentropy): Likewise. * libc/include/machine/_arc4random.h: New file. * libc/stdlib/arc4random.c: Likewise. * libc/stdlib/arc4random.h: Likewise. * libc/stdlib/arc4random_uniform.c: Likewise. * libc/stdlib/chacha_private.h: Likewise. * libc/sys/rtems/include/machine/_arc4random.h: Likewise. * libc/stdlib/Makefile.am (EXTENDED_SOURCES): Add arc4random.c and arc4random_uniform.c. * libc/stdlib/Makefile.in: Regenerate.
* Add timingsafe_memcmp()Sebastian Huber2016-03-184-18/+74
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_memcmp): Declare. * libc/string/timingsafe_memcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Add timingsafe_bcmp()Sebastian Huber2016-03-184-21/+59
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_bcmp): Declare. * libc/string/timingsafe_bcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Add explicit_bzero()Sebastian Huber2016-03-184-46/+75
| | | | | | | | | | This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (explicit_bzero): Declare. * libc/string/explicit_bzero.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
* Guard ssize_t definition by _SSIZE_T_DECLAREDSebastian Huber2016-03-181-0/+4
| | | | | | | | This guard is used by FreeBSD <sys/socket.h> for example. The FreeBSD network stack is used in RTEMS. * newlib/libc/include/sys/types.h (ssize_t): Guard by _SSIZE_T_DECLARED.
* Cygwin: define byteswap.h inlines as macrosYaakov Selkowitz2016-03-171-5/+9
| | | | | | | The bswap_* "functions" are macros in glibc, so they may be tested for by the preprocessor (e.g. #ifdef bswap_16). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: Cygwin headersYaakov Selkowitz2016-03-173-6/+9
| | | | | | Use proper internal macros for BSD and GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: sys/types.hYaakov Selkowitz2016-03-171-4/+7
| | | | | | | The u_int/u_char/etc. BSD types are needed by Cygwin's netinet/*.h headers, so they always need to be available. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Revert "Remove inclusion of sys/select.h in sys/types.h for backward compat"Yaakov Selkowitz2016-03-171-0/+2
| | | | | | This BSDism is still in use (e.g. putty). This reverts commit 088f7a723962dd18dcae09e8e8fa168bbea6ed0b.
* Feature test macros overhaul: sys/time.hYaakov Selkowitz2016-03-171-5/+8
| | | | | | | The inclusion of <sys/select.h> is required also by POSIX.1-2001. setitimer is XSI, and futimesat is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: sys/stat.hYaakov Selkowitz2016-03-171-10/+6
| | | | | | | Replace all !_POSIX_SOURCE with BSD. All *at functions depend on ATFILE; futimens is POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: sys/select.hYaakov Selkowitz2016-03-171-4/+5
| | | | | | Remove !_POSIX_SOURCE conditional; pselect is POSIX.1-2001. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: wchar.hYaakov Selkowitz2016-03-171-0/+2
| | | | | | open_wmemstream is POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: unistd.hYaakov Selkowitz2016-03-171-35/+41
| | | | | | | Throughout, use proper internal macros for functions, including those marked as target-specific. Use ATFILE for all *at functions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* Feature test macros overhaul: time.hYaakov Selkowitz2016-03-172-5/+17
| | | | | | Throughout, replace __STRICT_ANSI__ with the proper internal macros. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>