Commit Graph

1893 Commits

Author SHA1 Message Date
Hans-Peter Nilsson 82d7069a5e libc/machine/cris/sys/signal.h (kill): Declare. 2015-09-03 01:59:43 +02:00
Corinna Vinschen 38fd7ddb79 Allow sysconf to return CPU cache information
* include/sys/unistd.h (_SC_LEVEL*): Add cache-related variables as
        on Linux.

        * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information
        from new cache functions in sysconf.cc, get_cpu_cache_intel and
        get_cpu_cache_amd.
        * sysconf.cc (__nt_query_system): New local helper.
        (get_nproc_values): Utilize __nt_query_system on pre-Windows 7 systems.
        Use GetLogicalProcessorInformationEx otherwise to handle more than
        64 CPUs.  Only handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN.
        (get_phys_pages): New helper to handle _SC_PHYS_PAGES.
        (cpuid2_cache_descriptor): New array to map Intel CPUID 2 descriptor
        values to cache type, cache size, associativity and linesize.
        (cpuid2_cache_desc_compar): Comparision function for bsearch over
        cpuid2_cache_descriptor.
        (get_cpu_cache_intel_cpuid2): New function to fetch cache info from
        Intel CPUID 2.
        (get_cpu_cache_intel_cpuid4): Ditto from Intel CPUID 4.
        (get_cpu_cache_intel): New function as CPU-specific entry point.
        (assoc): New array to map associativity values from AMD CPUID
        0x80000006.
        (get_cpu_cache_amd): New function to fetch cache info from AMD CPUIDs
        0x80000005 and 0x80000006.
        (get_cpu_cache): New function to fetch cache info.
        (sca): Call get_phys_pages if _SC_PHYS_PAGES is requested.  Call
        get_cpu_cache for new _SC_* cache requests.
        (SC_MAX): Set to _SC_LEVEL4_CACHE_LINESIZE.
        (get_phys_pages(void)): Call get_phys_pages(int).
        * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

        * new-features.xml (ov-new2.3): Document sysconf cache addition.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-29 09:16:47 +02:00
Corinna Vinschen e6d9af11f1 strlen-armv7.S: Fix preprocessor check
Hi!

I've got the situation, that the function strlen() occurs twice in libc.a
(building newlib for ARM-V7a and Size-Optimized).

In newlib/libc/machine/arm/strlen.c there are the pre-processor stetements ...
#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
  (defined (__thumb__) && !defined (__thumb2__))
/*...*/
#else

#if !(defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__))
/*...*/
#endif

and in newlib/libc/machine/arm/strlen-armv7.S the "exclude" begins with

/* NOTE: This ifdef MUST match the ones in arm/strlen.c
   We fallback to the one in arm/strlen.c for size optimised or
   for older architectures. */
#if defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__) && \
    !(defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
      (defined (__thumb__) && !defined (__thumb2__)))

But this is not completely contrary to arm/strlen.c (see above)!

To fix the logical statement in arm/strlen-armv7.S there are parentheses needed

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-27 12:55:22 +02:00
Andre Simoes Dias Vieira 892cfcb7c2 Fix for pri and scn formats 2015-08-27 12:50:25 +02:00
James Greenhalgh 4eca8ea0cf Always declare "kill" in include/sys/signal.h
Hi,

As I mentioned recently [1], newlib is providing a "kill" symbol to link
against, without declaring "kill" in signal.h. This is confusing for the
libgfortran build, which tries to link against kill (which succeeds), then
tries to use it (which triggers -Werror=implicit-function-declaration).

This patch implements my suggestion in that thread - making the declaration
of 'kill' in libc/include/sys/signal.h unconditional.

I've tested this by building a modified libgfortran on AArch64/ARM to see
that the Werror goes away, and the libgfortran build succeeds.

Is something like this OK for newlib? If so, can someone please commit
it on my behalf, as I have no commit access here.

Otherwise, what is your preferred direction for me to take this patch?

Thanks,
James
2015-08-25 16:17:14 +02:00
Andre Vieira 9303de77d9 Add MIN MAX macro to param header file.
newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (MIN,MAX): Define.

From 536ca7365d269f5e56679048e336d6969186d550 Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 14:19:08 +0100
Subject: [PATCH] Added min max macros
2015-08-20 10:52:34 +02:00
Andre Vieira a732159809 Use machine header file for endianness configuration.
newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (BIG_ENDIAN, LITTLE_ENDIAN): Moved
   to machine/endian.h.
   * libc/machine/arm/machine/param.h (BYTE_ORDER): Idem.
   * libc/machine/arm/machine/endian.h: New.

From ca6efccda91bc6b620b7d96a466b0f1e2f02cfeb Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:16:20 +0100
Subject: [PATCH 2/2] Move endianness configuration to machine/endian.h
2015-08-20 10:52:34 +02:00
Andre Vieira 573532df7f Use machine header file for param configuration.
On 31/07/15 10:34, Richard Earnshaw wrote:
> On 31/07/15 10:28, Andre Vieira wrote:
>> newlib/ChangeLog:
>> 2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>    * libc/sys/arm/sys/param.h: Include machine/param.h
>>    (HZ, NOFILE, PATHSIZE): Define.
>>
>> param_refactor_1.patch
>>
>>
>>  From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
>> From: Andre Simoes Dias Vieira <andsim01@arm.com>
>> Date: Tue, 28 Jul 2015 12:10:59 +0100
>> Subject: [PATCH 1/2] Moved param configuration to machine/param.h
>>
>> ---
>>   newlib/libc/sys/arm/sys/param.h | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h
>> index adc066e9a8756e07edaaa8cadc79b5f05c996ac9..622c371972ab3c9dbb93ea5c51323a593e2a171a 100644
>> --- a/newlib/libc/sys/arm/sys/param.h
>> +++ b/newlib/libc/sys/arm/sys/param.h
>> @@ -3,9 +3,17 @@
>>   #ifndef _SYS_PARAM_H
>>   # define _SYS_PARAM_H
>>
>> -# define HZ (100)
>> -# define NOFILE	(60)
>> +#include <machine/param.h>
>> +
>> +#ifndef HZ
>> +# define HZ (60)
>
> Why have you changed the value for HZ?  It seems that, by convention,
> ARM boards have always used 100.
>
> R.
>
>> +#endif
>> +#ifndef NOFILE
>> +# define NOFILE>(60)
>> +#endif
>> +#ifndef PATHSIZE
>>   # define PATHSIZE (1024)
>> +#endif
>>
>>   #define BIG_ENDIAN      4321
>>   #define LITTLE_ENDIAN   1234
>>
>
Hi Richard,

ARM's machine/param.h that is included in "#include <machine/param.h>",
before the 'ifndef' already defines HZ to be 100. This file was already
there, it was just not being used. I understand that this 'ifndef' might
be confusing, though I decided to add it to mimic the behavior of the
default sys/param.h.

There is however an unrelated issue with this patch, a typo in the
"#define NOFILE" that crept in there due to some copy pasting when
splitting the patch.

Here is a fixed version.

BR,
Andre

newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h: Include machine/param.h
   (HZ, NOFILE, PATHSIZE): Define.

From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:10:59 +0100
Subject: [PATCH 1/2] Moved param configuration to machine/param.h
2015-08-20 10:52:34 +02:00
Yaakov Selkowitz 9f3100c958 sys/signal.h: include sys/ucontext.h on Cygwin per POSIX.1-2008
* libc/include/sys/signal.h [__CYGWIN__]: include <sys/ucontext.h>
if compiling for POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-08-18 11:05:41 +02:00
Jeff Johnston 4098f69c43 or1k: Fix critical handling in malloc locks
Only on first call to the recursive malloc lock the restore value of
    exception enable fields is stored.

    	  * libc/sys/or1k/mlock.c: Fix exception enable saving
2015-08-07 15:01:58 -04:00
Shoichi Sakon 001ef5af39 Fix wscanf family positional parameter handling in %lc, %ls, %l[]
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg
        to GET_ARG in %lc, %ls nad %l[] cases.  Fix unterminated string in %l[]
        case.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-08-03 21:51:35 +02:00
Jon TURNEY 6fc911071f Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64.
Fix documentation build since 6c2b1842 by not including stdio64 functions in the
reent syscalls menu if the node itself isn't going to be included because it's
under the STDIO64 flag.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-08-03 09:54:33 +01:00
Sebastian Huber b7ca25162a Fix typo in <sys/lock.h>
Sorry, there was a typo in <sys/lock.h> which leads to memory corruption
since not enough space is reserved for the lock object.

newlib/ChangeLog
2015-07-30  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/sys/rtems/include/sys/lock.h (__LOCK_INIT_RECURSIVE): Use
	proper type.
2015-07-31 06:21:04 -07:00
Wilco Dijkstra 127c38bd44 [AArch64] Rewrite optimized memset.
This is an optimized memset for AArch64.  Memset is split into 4 main
cases: small sets of up to 16 bytes, medium of 16..96 bytes which are
fully unrolled.  Large memsets of more than 96 bytes align the
destination and use an unrolled loop processing 64 bytes per
iteration.  Memsets of zero of more than 256 use the dc zva
instruction, and there are faster versions for the common ZVA sizes 64
or 128.  STP of Q registers is used to reduce codesize without loss of
performance.
2015-07-30 12:51:34 +01:00
Sebastian Huber f04e46b141 Move header files
During libgcc build the first include search path for <...> is
"../newlib/libc/sys/rtems/include".  Move all RTEMS specific header
files to "libc/sys/rtems/include" so that they can be found.  Later
during libc build the header files in the previous location were somehow
present, but for libgcc build they were invisible.  This change is
necessary to use <pthread.h> for the GCC thread model implementation.

newlib/ChangeLog
2015-07-27  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/sys/rtems/machine/_types.h: Move to ...
	libc/sys/rtems/include/machine/_types.h: ... here.
	libc/sys/rtems/machine/limits.h: Move to ...
	libc/sys/rtems/include/machine/limits.h: ... here.
	libc/sys/rtems/machine/param.h: Move to ...
	libc/sys/rtems/include/machine/param.h: ... here.
	libc/sys/rtems/sys/cpuset.h: Move to ...
	libc/sys/rtems/include/sys/cpuset.h: ... here.
	libc/sys/rtems/sys/dirent.h: Move to ...
	libc/sys/rtems/include/sys/dirent.h: ... here.
	libc/sys/rtems/sys/param.h: Move to ...
	libc/sys/rtems/include/sys/param.h: ... here.
	libc/sys/rtems/sys/syslimits.h: Move to ...
	libc/sys/rtems/include/sys/syslimits.h: ... here.
	libc/sys/rtems/sys/utime.h: Move to ...
	libc/sys/rtems/include/sys/utime.h: ... here.
2015-07-29 12:53:53 -07:00
Sebastian Huber ecaef05f66 Add <sys/lock.h>
Provide self-contained synchronization objects for RTEMS.  The API was
designed to be able to use it for the Newlib internal locks, the C11
threads support, the GCC thread model support and the libgomp operating
system configuration in combination with <pthread.h>.

References:

https://lists.rtems.org/pipermail/devel/2015-July/011989.html
https://lists.rtems.org/pipermail/devel/2015-July/012000.html

Tickets:

https://devel.rtems.org/ticket/1247
https://devel.rtems.org/ticket/2274.

v2: Fix typo in _Condition_Wait_recursive_timed() declaration.

newlib/ChangeLog
2015-07-28  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libc/sys/rtems/include/sys/lock.h: New.
2015-07-29 11:30:05 -07:00
Jon TURNEY 556a3ef544 Remove a stray sentence fragment in iconv.tex
I can't work out any meaning for this random sentence fragment, so remove it.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:09 +01:00
Jon TURNEY fde9684b52 Fix a typo in iconv.tex
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:07 +01:00
Jon TURNEY fdb73a8e43 Fix SYNPOSIS prototypes for iconv functions
Terminate all protoypes with a semicolon.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:05 +01:00
Jon TURNEY 6c2b184277 Use makedoc generated texinfo documentation for reentrant syscalls
We use texinfo nodes beginning with an underscore in several other places, so
revert this ancient workaround for a no longer existing bug, and use the makedoc
generated texinfo for reentrant versions of syscalls, rather than handwritten
documentation.

Also alphabetically sort these functions.

Also add documentation for _execve_r, _getpid_r, _kill_r and _times_r functions,
whose non-reentrant versions are documented as stubs

v2:
Keep _open64_r, _lseek64_r and _fstat64_r functions under texinfo conditional STDIO64
Add _stat64_r function likewise.

Notes:

1. The handwritten prototypes give the reentrancy structure pointer as of type
void *, rather than the presumably more correct struct __reent *

2. The fcntl, gettimeofday, mkdir and rename functions are not documented as
stubs, so I haven't added the reentrant versions either

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:03 +01:00
Jon TURNEY 1c19a13fd1 Add missing NEWPAGE commands to makedoc markup in reent/
makedoc requires a NEWPAGE command to preceed the second and subsequent FUNCTION
commands in a file in order to produce the correct texinfo output.

Add missing NEWPAGE commands needed in reent/execr.c. and reent/signalr.c, which
contain makedoc markup for multiple functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-07-24 15:50:00 +01:00
Corinna Vinschen 7c96ab0b43 Cygwin: Implement siglongjmp and sigsetjmp functions.
* libc/include/machine/setjmp.h (siglongjmp): Declare as function on
	Cygwin.
	(sigsetjmp): Ditto.
	(_longjmp): Mark as noreturn function on Cygwin.

	* common.din (siglongjmp): Export.
	(sigsetjmp): Export.
	* gendef: Change formatting of some comments.
	(sigsetjmp): Implement.
	(siglongjmp): Implement.
	(__setjmpex): x86_64 only: Drop entry point.
	(setjmp): x86_64 only: Store tls stackptr in Frame now, store MXCSR
	and FPUCW registers in Spare, as MSVCRT does.
	(longjmp): x86_64 only: Restore tls stackptr from Frame now, restore
	MXCSR and FPUCW registers from Spare.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

	* new-features.xml (ov-new2.2): Document sigsetjmp, siglongjmp.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-21 17:31:02 +02:00
Marcus Shawcroft c7806ef76a [AArch64] Reverting recent optimized memset(). 2015-07-15 13:34:58 +01:00
Wilco Dijkstra 3263f90ef7 [AArch64] Optimized memset.
This is an optimized memset for AArch64.  Memset is split into 4 main
cases: small sets of up to 16 bytes, medium of 16..96 bytes which are
fully unrolled.  Large memsets of more than 96 bytes align the
destination and use an unrolled loop processing 64 bytes per
iteration.  Memsets of zero of more than 256 use the dc zva
instruction, and there are faster versions for the common ZVA sizes 64
or 128.  STP of Q registers is used to reduce codesize without loss of
performance.
2015-07-13 13:17:16 +01:00
Wilco Dijkstra b295f6ba44 [AArch64] Optimized memcpy.
This is an optimized memcpy for AArch64.  Copies are split into 3 main
cases: small copies of up to 16 bytes, medium copies of 17..96 bytes
which are fully unrolled.  Large copies of more than 96 bytes align
the destination and use an unrolled loop processing 64 bytes per
iteration.  In order to share code with memmove, small and medium
copies read all data before writing, allowing any kind of overlap.  On
a random copy test memcpy is 40.8% faster on A57 and 28.4% on A53.
2015-07-13 13:09:02 +01:00
Wilco Dijkstra 9503c7f275 [AArch64] Optimized memmove.
This is an optimized memmove for AArch64.  All copies of up to 96
bytes and all backward copies are done by the new memcpy.  The only
remaining case is large forward copies which are done in the same way
as the memcpy loop, but copying from the end rather than the start.
2015-07-13 13:03:02 +01:00
Yaakov Selkowitz 79e419de62 Rework handling of basename variants
As a commonly-included header, the #define basename in <string.h> can
affect code which uses "basename" for its own purposes (e.g. struct
members or C++ namespaced functions).  When such cases occur and some
code includes <string.h> and some not, then errors result.  OTOH,
<libgen.h> is rarely used, and that's where the renaming occurs in
glibc, so code using <libgen.h> should already be safe.

* libc/include/libgen.h (basename): Define as __xpg_basename
for source compatibility with glibc.
Declare with __ASMNAME("basename") for ABI compatibility.
* libc/include/string.h (basename): Define as basename for
source compatibility with glibc.
Declare with __ASMNAME("__gnu_basename") for ABI compatibility.
2015-07-06 14:58:51 -05:00
Corinna Vinschen f9b87aaf10 Fix sys/time.h build problem due to inconsistent macro usage
https://sourceware.org/ml/newlib/2015/msg00520.html describes
	how sys/time.h uses __BSD_VISIBLE while the types used in the
	affected inline functions are guarded with !_POSIX_SOURCE.
	Fix that by guarding the type with __BSD_VISIBLE as well.

        * libc/include/sys/time.h: Explicitely include sys/cdefs.h.
        * libc/include/sys/types.h: Ditto.  Guard BSD convenience base types
        with __BSD_VISIBLE rather than !_POSIX_SOURCE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-06 14:08:30 +02:00
Sebastian Huber 757c0871f7 Prevent use of uninitialized file lock
The CHECK_INIT() is necessary before the _newlib_flockfile_start() since
this would use otherwise acquire an uninitialized lock which gets
initialized after this leading to a corrupt release.

newlib/ChangeLog
2015-07-01  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT().
	libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and
	CHECK_INIT().  Use _stdin_r() to get the file pointer instead of stdin.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-07-02 09:38:06 +02:00
Jon TURNEY 166d86c9d4 Regenerate Makefile.in
Regenerate Makefile.in with changes in commits 153385d8 and 433aad91

2015-06-29  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/ctype/Makefile.in: Regenerate.
	* libc/posix/Makefile.in: Ditto.
	* libc/stdio/Makefile.in: Ditto.
	* libc/stdio64/Makefile.in: Ditto.
	* libc/stdlib/Makefile.in: Ditto.
	* libc/string/Makefile.in: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-29 12:29:50 +01:00
Jon TURNEY 153385d847 Use source files which have makedoc markup, but aren't processed or included.
These source files have makedoc markup, but aren't listed to be chewed by
makedoc. I am assuming that is accidental.

Future work: Note that stdio/fseeko.c, stdio/ftello.c and common/s_isnand.c have
makedoc markup, but duplicate stdio/fseek.c, stdio/ftell.c and common/s_isnan.c
respectively.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/ctype/Makefile.am (CHEWOUT_FILES): Add isblank.def.
	* libc/ctype/ctype.tex: Include isblank and add to menu.
	* libc/posix/Makefile.am (CHEWOUT_FILES): Add posix_spawn.def.
	* libc/posix/posix.tex: Include posix_spawn and add to menu.
	* libc/stdio64/Makefile.am (CHEWOUT_FILES): Add fdopen.def.
	* libc/stdio64/stdio64.tex: Include fdopen64 and add to menu.
	* libc/stdio64/fdopen64.c: Improve one-line description.
	* libc/string/Makefile.am (CHEWOUT_FILES): Add strchrnul.def.
	* libc/string/strings.tex: Include strchrnul and add to menu.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:24:01 +01:00
Jon TURNEY a4dd7dd87c Use makedoc output files which are generated but aren't included
I think these are accidental omissions, as these source files are listed to be
chewed by makedoc, but the result is not included by any texinfo source file.

Future work: Nothing in libc/reent/ which is processed by makedoc is included by
reent.tex

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/stdlib.tex: Include itoa and utoa, and add to menu.
	* libc/string/strings.tex: Include memrchr and rawmemchr, and add
	to menu.
	* libm/math/math.tex: Include exp10 and pow10, and add to menu.
	* libm/common/s_exp10.c: Improve one-line description.
	* libm/common/s_exp10.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:55 +01:00
Jon TURNEY 433aad912d Don't chew files which contain no documentation markup
Don't chew files which contain no documentation markup.

Neither of the alternatives for MALLOCR (mallocr.c or nano-mallocr.c) contain
any documentation markup.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/Makefile.am (CHEWOUT_FILES): Remove $(MALLOCR).def.
	* libc/stdio/Makefile.am (CHEWOUT_FILES): Remove getwc.def and
	putwc.def.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:49 +01:00
Jon TURNEY 958c953416 Fix mismatched parentheses in documentation.
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/locale/locale.c: Fix mismatched parentheses in
	documentation.
	* libc/locale/locale.tex: Ditto.
	* libc/stdio/fgetwc.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-24 12:23:25 +01:00
Jon TURNEY de5e58a640 Fix typo-ed function names in efgcvt.c documentation
Fix typo-ed function names in efgcvt.c documentation, neither gvcvt nor gdvtf
exists.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/efgcvt.c: Fix typo-ed function names in
	documentation.
	* libc/stdlib/stdlib.tex: Fix function name in menu to match.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 20:56:30 +01:00
Jon TURNEY eb61ffe8dd Fix an inconsistent use of '.' in FUNCTION
Fix an inconsistent use of '.' to separate function names in FUNCTION. ',' is
used everywhere else.

2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/fread.c: Fix inconsistent use of '.' to separate
	function names in FUNCTION mark up.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 20:56:15 +01:00
Jon TURNEY ff4a4f2655 Fix SYNOPSIS prototypes without marked up parameter names
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/llabs.c: Mark up parameter name in ANSI_SYNOPSIS.
	* libc/time/tzset.c: Add and mark up parameter in SYNOPSIS.
	* libm/common/s_nan.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:22 +01:00
Jon TURNEY 6c75f6fcb2 Correct a non-ANSI prototype in SYNOPSIS
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdio/getchar_u.c: Fix a non-ANSI prototype in SYNOPSIS.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:17 +01:00
Jon TURNEY e8442c9625 Remove stray punctuation in ANSI_SYNOPSIS prototypes
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/string/wcscpy.c: Remove stray ',' from prototype in
	ANSI_SYNOPSIS.
	* libc/string/wcpcpy.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 17:30:07 +01:00
Jon TURNEY c7b1e4cbf2 Fix some mangled makedoc markup
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/stdlib/itoa.c: Fix makedoc markup.
	* libc/stdlib/wcsnrtombs.c: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 16:14:53 +01:00
Jon TURNEY 42e040a448 Fix makedoc markup used in texinfo source
2015-06-23  Jon Turney  <jon.turney@dronecode.org.uk>

	* libc/signal/signal.tex: Use texinfo not makedoc markup.
	* libc/stdio/stdio.tex: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-06-23 16:14:39 +01:00
Corinna Vinschen 2b615b47d4 sys/signal.h requires sys/cdefs.h
* libc/include/sys/signal.h: Include forgotten sys/cdefs.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-22 10:49:29 +02:00
Corinna Vinschen 6442e914d9 Use MINSIGSTKSZ and SIGSTKSZ from newlib for Cygwin as well
* libc/include/sys/signal.h: Move altstack macros completely
	outside of rtems block.

	* include/cygwin/signal.h: Remove definitions of MINSIGSTKSZ
	and SIGSTKSZ here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-20 19:05:51 +02:00
Corinna Vinschen 22465796ed Preliminary infrastructure to implement alternate stack
* libc/include/sys/signal.h: Define SS_ONSTACK and SS_DISABLE
	unconditionally.
	(sigaltstack): Enable prototype on Cygwin.

	* common.din (sigaltstack): Export.
	* cygtls.cc (_cygtls::init_thread): Initialize altstack.
	* cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish
	more clearly from stack_t.  Accommodate throughout.
	(_cygtls): Add altstack member.
	* exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL
	if we encounter a stack overflow, and no alternate stack has been
	defined.
	* include/cygwin/signal.h (MINSIGSTKSZ): Define
	(SIGSTKSZ): Define.
	(SA_ONSTACK): Define.
	* signal.cc (sigaltstack): New function.
	* tlsoffset.h: Regenerate.
	* tlsoffset64.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-19 16:12:45 +02:00
Freddie Chopin 325926031b gmtime_r: Use faster algorithm by Howard Hinnant
* libc/time/gmtime_r.c (gmtime_r): use faster algorithm from
	civil_from_days() by Howard Hinnant

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-15 12:00:59 +02:00
Hale Wang 24e054c8c8 Update the assembler code to support old ARM architectures.
* libc/machine/arm/aeabi_memmove-arm.S (__aeabi_memmove): Update the
        assembler implementation.
        * libc/machine/arm/aeabi_memmove-thumb.S (__aeabi_memmove): Ditto.
        * libc/machine/arm/aeabi_memmove-thumb2.S (__aeabi_memmove): Ditto.
        * libc/machine/arm/aeabi_memset-arm.S (__aeabi_memset): Ditto.
        * libc/machine/arm/aeabi_memset-thumb.S (__aeabi_memset): Ditto.
        * libc/machine/arm/aeabi_memset-thumb2.S (__aeabi_memset): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-01 12:49:37 +02:00
David Stacey 8fe35bd15f Correct argz_replace behaviour when memory is exhausted.
* libc/argz/argz_replace.c (argz_replace): Correct behaviour when memory
	is exhausted.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-06-01 10:09:04 +02:00
Corinna Vinschen 1aeda8a95f Fix comment in sys/wait.h
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-28 16:40:43 +02:00
David Stacey ca632c9015 Fix potential memory leak in argz_replace
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-27 13:30:20 +02:00
Corinna Vinschen a7a784c774 Revert to exposing sys/select.h from sys/time.h on Cygwin
* libc/include/sys/time.h: Include sys/select.h on Cygwin.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-05-02 15:09:03 +02:00