summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make ldd stop after any non-continuable exceptionJon Turney2017-04-041-1/+9
| | | | | | | | | | Ensure that ldd always stops when the exception is flagged as non-continuable. Also arrange for ldd to exit with a non-zero exit code if something went wrong which prevented us from listing all dynamic dependencies. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Cygwin: Export reallocarrayCorinna Vinschen2017-04-043-1/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump Cygwin to 2.8.1Corinna Vinschen2017-04-041-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add BSD-specific reallocarray()Sebastian Huber2017-04-044-17/+68
| | | | | It is available in FreeBSD, NetBSD and OpenBSD, but not in glibc. It is used for example by OpenSSH.
* Renumber copyright clause 4imp2017-04-041-1/+1
| | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96
* queue.3: Document existing QMD_* macroscem2017-04-041-0/+39
| | | | | | Feedback from: bapt, bdrewery, emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D3983
* queue(3): Enhance queue debugging macroscem2017-04-041-5/+37
| | | | | | | | | | | | | Split the QUEUE_MACRO_DEBUG into QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH. Add the debug macrso QMD_IS_TRASHED() and QMD_SLIST_CHECK_PREVPTR(). Document these in queue.3. Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D3984
* Add two new macros, SLIST_CONCAT and LIST_CONCATmckusick2017-04-041-2/+36
| | | | | | | | | Add two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the queue.h header file and in the queue.3 manual page that they are O(n) so should be used only in low-usage paths with short lists (otherwise an STAILQ or TAILQ should be used). Reviewed by: kib
* Make the <sys/queue.h> fully usable within C++hselasky2017-04-041-14/+73
| | | | | | | | | | | | | | | | | | Make the system queue header file fully usable within C++ programs by adding macros to define class lists. This change is backwards compatible for all use within C and C++ programs. Only C++ programs will have added support to use the queue macros within classes. Previously the queue macros could only be used within structures. The queue.3 manual page has been updated to describe the new functionality and some alphabetic sorting has been done while at it. Differential Revision: https://reviews.freebsd.org/D2745 PR: 200827 (exp-run) MFC after: 2 weeks
* Pass macro arguments properly.hselasky2017-04-041-2/+2
| | | | MFC after: 1 week
* Fix order of arguments in the TRACEBUF_INITIALIZERhselasky2017-04-041-1/+1
| | | | | | | Fix order of arguments in the TRACEBUF_INITIALIZER macro so that we can define QUEUE_MACRO_DEBUG to debug list problems. MFC after: 1 week
* Add new FOREACH_FROM variants for queue(3)lstewart2017-04-041-0/+53
| | | | | | | | | | | | | Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can optionally start the traversal from a previously found element by passing the element in as "var". Passing a NULL "var" retains the same semantics as the regular FOREACH macros. Kudos to phk for suggesting the "FROM" suffix instead of my original proposal. Reviewed by: jhb (previous version), rpaulo MFC after: 1 week
* Renumber copyright clause 4imp2017-04-041-1/+1
| | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96
* don't use C99 static array indices with older GCC versionsavg2017-04-041-0/+1
| | | | | | | | | | | | | | For example, the FreeBSD GCC (4.2.1) has a spotty support for that feature. If the static keyword is used with an unnamed array parameter in a function declaration, then the compilation fails with: error: static or type qualifiers in abstract declarator The feature does work if the parameter is named. So, the restriction introduced in this commit can be removed when all affected function prototypes have the workaround. MFC after: 1 week Sponsored by: Panzura
* Addition of clang nullability qualifiers.pfg2017-04-041-0/+7
| | | | | | | | | | | | | | | For consistency with the qualifiers added in r310977, define a new qualifier _Null_unspecified which is also defined in clang 3.7+. Add two new macros: __NULLABILITY_PRAGMA_PUSH __NULLABILITY_PRAGMA_POP These are for use in headers when we want avoid noisy warnings if some pointers are left without nullability annotations. These are added with way ahead of their first use to teach the GCC ports headers of their existance before their first use.
* Remove unused __gnu_inline() attribute.pfg2017-04-041-16/+0
| | | | | | | | | | | | This was meant to be used by a future FORTIFY_SOURCE implementation. Probably for good, FORTIFY_SOURCE and this particular GCCism were never well supported by clang or other compilers. Furthermore, the technology has long since been replaced by either static checkers, sanitizers, or even just the strong stack protector that was enabled by default. Drop __gnu_inline to avoid cluttering the headers. MFC after: 5 days
* Addition of clang nullability qualifiers.pfg2017-04-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Add two new qualifiers for use by the static checkers: _Nonnull The _Nonnull nullability qualifier indicates that null is not a meaningful value for a value of the _Nonnull pointer type. _Nullable The _Nullable nullability qualifier indicates that a value of the _Nullable pointer type can be null. These were introduced in Clang 3.7. For more information, see: http://clang.llvm.org/docs/AttributeReference.html#nonnull We add these now without using them so that the GCC ports have time to pick up the header change. Hinted by: Android Bionic libc [1] Also seen in: Apple's Libc-1158.20.4 [1] https://github.com/android/platform_bionic/commit/baa2a973bd776a51bb05a8590ab05d86eea7b321
* Fix C++ includability of crypto headers with static array sizesasomers2017-04-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | C99 allows array function parameters to use the static keyword for their sizes. This tells the compiler that the parameter will have at least the specified size, and calling code will fail to compile if that guarantee is not met. However, this syntax is not legal in C++. This commit reverts r300824, which worked around the problem for sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can be used in headers as a static array size, but will still compile in C++ mode. Reviewed by: cem, ed MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8277 fix a typo in __STDC_VERSION__ in __min_size requirements MFC after: 1 week Sponsored by: Panzura
* Stop exposing the C11 _Atomic() macro in <sys/cdefs.h>, when compiling for C++.dim2017-04-041-1/+2
| | | | | | | | | | | It clashes with the one in libc++'s <atomic> header. (Previously, the _Atomic() macro was defined in <stdatomic.h>, which is only for use with C11, but for various reasons it was moved to its current location in r251804.) Discussed with: bdrewery, ed MFC after: 2 weeks
* Rename __sentinel to __null_sentinelpfg2017-04-041-2/+2
| | | | | | GCC 5 uses a conflicting __sentinel definition in include/c++/bits/stl_algo.h Reported by: matteo
* Use enum __packed in favour of -fshort-enumsSebastian Huber2017-04-036-48/+49
| | | | | | | | | | | | Some architectures like ARM encode the short enum option state in the object file and the linker checks that this option is consistent for all objects of an executable. In case applications use -fno-short-enums, then this leads to linker warnings. Use the enum __packed attribute for the relevent enums to avoid the -fshort-enums compiler option. This attribute is at least available on GCC, LLVM/clang and the Intel compiler. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* Use .syntax unified instead of .syntax divided.cygwin-2_8_0-releaseCatherine Moore2017-03-302-2/+2
|
* Add latest changes to Cygwin release informationCorinna Vinschen2017-03-282-2/+18
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Change CURR_SHARED_MAGIC to account for getloadavg patchCorinna Vinschen2017-03-281-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement getloadavg()Jon Turney2017-03-2711-4/+240
| | | | | | | | | | | | | | | v2: autoload PerfDataHelper functions Keep loadavg in shared memory Guard loadavg access by a mutex Initialize loadavg to the current load v3: Shared memory version bump isn't needed if we are only extending it Remove unused autoload Mark inititalized flags as NO_COPY for correct behaviour in fork child Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* declaration of ppoll() by poll.h should be guarded by _GNU_SOURCEJon Turney2017-03-271-0/+2
| | | | Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Recognize Netapp mode supporting reparse pointsCorinna Vinschen2017-03-271-0/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwin: Do not generate surrogate chars on netappCorinna Vinschen2017-03-241-1/+1
| | | | | | | Just like Samba, Netapp FSes seem to dislike invalid surrogate usage in filenames. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document cygserver changesCorinna Vinschen2017-03-241-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: Speed up non-debug scenarioCorinna Vinschen2017-03-247-16/+30
| | | | | | | | | _log/_vlog were always called so we always had a function call hit even if we're not debugging. Expand on the debugging macros so the decision to call _log/_vlog is done in the caller already. Also, make a log level difference between syscall_printf and system_printf. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: Small code cleanupCorinna Vinschen2017-03-242-3/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: Revamp thread sleep handlingCorinna Vinschen2017-03-245-99/+71
| | | | | | | | | | | | | | | | | | | | The current implementation is a very simple approach to implement a statically sized sleep queue. The problem is that this code requires a certain amount of synchronization because the slots in the queue are used dynamically. To top it off, the Event objects used for sync'ing are created and destroyed on demand. This is complicated, slow, and error prone. There's also a blatant bug here: The number of slots in the queue was wrongly computed in size. It was too small if XSI IPC was used a lot. Make the code more robust. Let the queue have the right size. Every slot is now used for a specific IPC object. All sync objects (switched to Semaphores) are only created when first required, but never destroyed. This reduces the usage of a critical section to the creation of a new sync object. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: raise number of worker threads on demandCorinna Vinschen2017-03-242-12/+11
| | | | | | | | | | | | | The number of threads in the worker pool is fixed so far. This is a problem in XSI IPC scenarions with an unknown number of consumers. It doesn't make sense to make the pool very big for a start, but when the need arises, we need to make sure we can serve the request even if all other worker threads are in a wait state. This patch changes threaded_queue to just add another worker thread if all current workers are busy. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: Only print basename of source in debug output to raise readabilityCorinna Vinschen2017-03-241-1/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygserver: Seralize debug output to stdout to raise readabilityCorinna Vinschen2017-03-241-0/+13
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* dlfcn: Remove stray debug outputnewlib-snapshot-20170323Corinna Vinschen2017-03-222-2/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Rename <sys/_locale.h> to <xlocale.h>Yaakov Selkowitz2017-03-2212-13/+18
| | | | | | | | | The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin. While, like on some of those systems, it is automatically included by <locale.h> with the proper feature test macros, its presence under this particular name is still presumed in real-world software. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ARM: Fix IEEE-754 sqrt implementationSebastian Huber2017-03-222-2/+2
| | | | | Older GCC (e.g. 4.9.3) seem to define __ARM_FP even in case soft-float is used.
* ARM: Optimize IEEE-754 sqrt implementationSebastian Huber2017-03-214-1/+108
| | | | Use the vsqrt.f64 and vsqrt.f32 instructions if available.
* Cygwin: dlfcn: Fix reference countingCorinna Vinschen2017-03-213-34/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original dll_init code was living under the wrong assumption that dll_dllcrt0_1 and in turn dll_list::alloc will be called for each LoadLibrary call. The same wrong assumption was made for cygwin_detach_dll/dll_list::detach called via FreeLibrary. In reality, dll_dllcrt0_1 gets only called once at first LoadLibrary and cygwin_detach_dll once at last FreeLibrary. In effect, reference counting for DLLs was completely broken after fork: parent: l1 = dlopen ("lib1"); // LoadLibrary, LoadCount = 1 l2 = dlopen ("lib1"); // LoadLibrary, LoadCount = 2 fork (); // LoadLibrary in the child, LoadCount = 1! child: dlclose (l1); // FreeLibrary actually frees the lib x = dlsym (l2); // SEGV * Move reference counting to dlopen/dlclose since only those functions have to keep track of loading/unloading DLLs in the application context. * Remove broken accounting code from dll_list::alloc and dll_list::detach. * Fix error handling in dlclose. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* libc/string/strsignal.c: Use of || not && lead to dead code.Joel Sherrill2017-03-151-4/+2
| | | | Coverity Id: 175333
* rtems/crt0.c: getentropy() stub did not return a value.Joel Sherrill2017-03-151-1/+1
| | | | Coverity Scan ID: 175342
* Add release message for commit 973f766f6Corinna Vinschen2017-03-141-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Revert "Add release message for commit 973f766f6"Corinna Vinschen2017-03-142-6/+12
| | | | | | This reverts commit 125852d77b65fe2155d0d5fa97e53fc9e2b29984. Accidentally commited too much.
* Add release message for commit 973f766f6Corinna Vinschen2017-03-142-12/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix duplocale (libc/locale/duplocale.c) which fails to properly call ↵Koichi Murase2017-03-132-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __loadlocale Problem: After passing locales created by 'duplocale' to 'uselocale', referencing 'MB_CUR_MAX', which is actually expanded to '__locale_mb_cur_max()' by preprocessors, causes segmentation faults. Direct use of locales from 'newlocale' does not cause the problem. This is the problem of 'duplocale'. $ echo $LANG ja_JP.UTF-8 $ cat test.c #include <stdlib.h> #include <locale.h> volatile int var; int main(void) { locale_t const loc = newlocale(LC_ALL_MASK, "", NULL); locale_t const dup = duplocale(loc); locale_t const old = uselocale(dup); var = MB_CUR_MAX; /* <-- crashes here */ uselocale(old); freelocale(dup); freelocale(loc); return 0; } $ gcc test.c $ ./a Segmentation fault (core dumped) # Note: "core dumped" in the above message was actually written in # Japanese, but I translated the part to post a mail in English. Bug: In the beginning of '__loadlocale' (newlib/libc/locale/locale.c:501), there is a code which checks if the operations can be skipped: > /* Avoid doing everything twice if nothing has changed. */ > if (!strcmp (new_locale, loc->categories[category])) > return loc->categories[category]; While, in the function '_duplocale_r' (newlib/libc/locale/ duplocale.c), '__loadlocale' is called as in the quoted codes: > /* If the object is not a "C" locale category, copy it. Just call > __loadlocale. It knows what to do to replicate the category. */ > tmp_locale.lc_cat[i].ptr = NULL; > tmp_locale.lc_cat[i].buf = NULL; > if (!__loadlocale (&tmp_locale, i, tmp_locale.categories[i])) > goto error; This call of '__loadlocale' results in the skip check being !strcmp(tmp_locale.categories[i], tmp_locale.categories[i]), which is always true. This means that the actual operations of '__loadLocale' will never be performed for 'duplocale'. Fix: The call of '__loadlocale' in '_duplocale_r' is modified. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Extend 2.8.0 release textCorinna Vinschen2017-03-121-0/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement fhandler_dev_null::write to workaround a problem with NULCorinna Vinschen2017-03-122-0/+11
| | | | | | | | Windows NUL device returns only the lower 32 bit of the number of bytes written. Implement a fake write function to ignore the underlying NUL device. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Return value from write is ssize_t, not intCorinna Vinschen2017-03-121-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* getrandom: it's MIN, not MAXYaakov Selkowitz2017-03-112-1/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>