]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
8 years agoor1k: Make heap end globally visible
Jeff Johnston [Fri, 7 Aug 2015 18:43:38 +0000 (14:43 -0400)]
or1k: Make heap end globally visible

    Boards may change the initial value from _end to another value.

           * or1k/sbrk.c: Make heap end globally visible

8 years agoImprove FAQ answer on debugging Cygwin
Jon TURNEY [Tue, 4 Aug 2015 12:34:10 +0000 (13:34 +0100)]
Improve FAQ answer on debugging Cygwin

Improve FAQ answer on debugging Cygwin to mention the cygwin-debuginfo package
and the gdb command 'set cygwin-exceptions on'.

2015-08-03  Jon Turney  <jon.turney@dronecode.org.uk>

* faq-programming.xml: Improve debugging-cygwin answer.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
8 years agoThis is part of a larger fix for RL78 complex relocs - they need an absolute symbol...
Nick Clifton [Tue, 4 Aug 2015 12:38:27 +0000 (13:38 +0100)]
This is part of a larger fix for RL78 complex relocs - they need an absolute symbol at address 0 that is not part of the *ABS* section.

* rl78/rl78-sim.ld: Provide a value for __rl78_abs__.
* rl78/rl78.ld: Likewise.

8 years agoFix wscanf family positional parameter handling in %lc, %ls, %l[]
Shoichi Sakon [Mon, 3 Aug 2015 19:51:16 +0000 (21:51 +0200)]
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>
8 years agoBump Cygwin DLL minor number.
Corinna Vinschen [Mon, 3 Aug 2015 19:46:55 +0000 (21:46 +0200)]
Bump Cygwin DLL minor number.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agostrace: Handle ofile descriptor more carefully. cygwin-2_2_0-release
Corinna Vinschen [Mon, 3 Aug 2015 10:02:17 +0000 (12:02 +0200)]
strace: Handle ofile descriptor more carefully.

Fix coverity CIDs 128250 - 128252

        * strace.cc (main2): Don't call setvbuf on NULL descriptor.
        Explicitely fclose ofile.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDon't include stdio64 functions in reentrant syscalls menu when not bulding stdio64.
Jon TURNEY [Wed, 29 Jul 2015 15:48:00 +0000 (16:48 +0100)]
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>
8 years agoFix typo in <sys/lock.h>
Sebastian Huber [Thu, 30 Jul 2015 07:53:04 +0000 (02:53 -0500)]
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.

8 years ago[AArch64] Rewrite optimized memset.
Wilco Dijkstra [Thu, 30 Jul 2015 11:51:34 +0000 (12:51 +0100)]
[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.

8 years agoCygwin: Fix x86_64 memcpy/memset for n > 2GB
Corinna Vinschen [Wed, 29 Jul 2015 20:09:34 +0000 (22:09 +0200)]
Cygwin: Fix x86_64 memcpy/memset for n > 2GB

https://cygwin.com/ml/cygwin/2015-07/msg00344.html:

RtlFillMemory and RtlCopyMemory only work for size values
up to 2GB.  Fix this problem by using NetBSD code for
memset and memcpy.  Add entry points for memmove, wmemset,
wmemmove, wmemcpy.  Thanks to Roman Petrovski
<RPetrovski@illumina.com> for pointing this out.

        * miscfuncs.cc (memset): x86_64 only: Implement in assembler.
        (memmove,memcpy): x86_64 only: Ditto.
        (wmemmove,wmemcpy): x86_64 only: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoMove header files
Sebastian Huber [Mon, 27 Jul 2015 09:31:26 +0000 (11:31 +0200)]
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.

8 years agonewlib/ChangeLog: Left out of previous commit.
Joel Sherrill [Wed, 29 Jul 2015 19:48:07 +0000 (12:48 -0700)]
newlib/ChangeLog: Left out of previous commit.

8 years agoAdd <sys/lock.h>
Sebastian Huber [Tue, 28 Jul 2015 09:32:05 +0000 (04:32 -0500)]
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.

8 years agocygwin: Fix copyright dates
Corinna Vinschen [Wed, 29 Jul 2015 11:45:46 +0000 (13:45 +0200)]
cygwin: Fix copyright dates

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agocygwin: Fix crashes under AllocationPreference=0x100000 condition
Corinna Vinschen [Wed, 29 Jul 2015 11:32:29 +0000 (13:32 +0200)]
cygwin: Fix crashes under AllocationPreference=0x100000 condition

        * cygtls.h: Include cygtls_padsize.h and define CYGTLS_PADSIZE there.
        * cygtls_padsize.h: New file.  Define CYGTLS_PADSIZE.
        * environ.cc (parse_options): Fix NULL pointer access.
        * init.cc (threadfunc_fe): Do not force stack align on x86_64.

        * strace.cc (main2): Rename from main.
        (main): Make room for _cygtls area on stack and just call main2.  Add
        comment to explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRemove workaround for texinfo bug with underscores in filenames from mothballed mathfp/ newlib-snapshot-20150723
Jon TURNEY [Wed, 15 Jul 2015 14:40:38 +0000 (15:40 +0100)]
Remove workaround for texinfo bug with underscores in filenames from mothballed mathfp/

This got removed everywhere else in commit 139f923b, so I'm assuming whatever
ancient bug this was has been fixed long since.

There are plenty of other uses of texinfo with a filename containing an
underscore now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoRemove a stray sentence fragment in iconv.tex
Jon TURNEY [Tue, 21 Jul 2015 12:50:22 +0000 (13:50 +0100)]
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>
9 years agoFix a typo in iconv.tex
Jon TURNEY [Tue, 21 Jul 2015 12:47:14 +0000 (13:47 +0100)]
Fix a typo in iconv.tex

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoFix SYNPOSIS prototypes for iconv functions
Jon TURNEY [Tue, 21 Jul 2015 12:46:46 +0000 (13:46 +0100)]
Fix SYNPOSIS prototypes for iconv functions

Terminate all protoypes with a semicolon.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoUse makedoc generated texinfo documentation for reentrant syscalls
Jon TURNEY [Tue, 21 Jul 2015 12:41:46 +0000 (13:41 +0100)]
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>
9 years agoAdd missing NEWPAGE commands to makedoc markup in reent/
Jon TURNEY [Tue, 21 Jul 2015 12:42:04 +0000 (13:42 +0100)]
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>
9 years agoImprove cygwin 2.2.0 release text
Corinna Vinschen [Thu, 23 Jul 2015 19:19:43 +0000 (21:19 +0200)]
Improve cygwin 2.2.0 release text

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix potential buffer overflow in makecontext trampoline
Corinna Vinschen [Thu, 23 Jul 2015 18:25:22 +0000 (20:25 +0200)]
Fix potential buffer overflow in makecontext trampoline

glibc's tst-makecontext2 testcase uncovered a bug in
__cont_link_context.  If the function misses to reserve
shadow space for the calls to setcontext/cygwin_exit,
both functions could overwrite memory beyond the stack
configured in uc_stack.

        * exceptions.cc (__cont_link_context): x86_64: align stack and reserve
        shadow space for subsequent function calls, otherwise suffer potential
        buffer overflow.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoIgnore non-absolute $HOME when started from native process
Corinna Vinschen [Thu, 23 Jul 2015 15:42:07 +0000 (17:42 +0200)]
Ignore non-absolute $HOME when started from native process

* uinfo.cc (cygheap_user::ontherange): Ignore $HOME if it's not
starting with a slash (aka, absolute POSIX Path).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoCygwin: Implement siglongjmp and sigsetjmp functions.
Corinna Vinschen [Tue, 21 Jul 2015 15:31:02 +0000 (17:31 +0200)]
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>
9 years agoAdd previous ldd fix to release file
Corinna Vinschen [Mon, 20 Jul 2015 16:43:16 +0000 (18:43 +0200)]
Add previous ldd fix to release file

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix potential hang in ldd if DLL encounters missing entry point
Corinna Vinschen [Mon, 20 Jul 2015 16:32:24 +0000 (18:32 +0200)]
Fix potential hang in ldd if DLL encounters missing entry point

         * ldd.cc (STATUS_DLL_NOT_FOUND): Drop definition.
        (report): Handle STATUS_ENTRYPOINT_NOT_FOUND exception.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoLower Cygwin's MINSIGSTKSZ and SIGSTKSZ
Corinna Vinschen [Sun, 19 Jul 2015 20:40:29 +0000 (22:40 +0200)]
Lower Cygwin's MINSIGSTKSZ and SIGSTKSZ

        * include/cygwin/signal.h (MINSIGSTKSZ): Define as 8K, unconditionally.
        (SIGSTKSZ): Define as 32K, unconditionally.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoReduce stack pressure throughout Cygwin
Corinna Vinschen [Sun, 19 Jul 2015 20:38:30 +0000 (22:38 +0200)]
Reduce stack pressure throughout Cygwin

        * dcrt0.cc (initial_env): Reduce size of local path buffers to
        PATH_MAX.  Allocate debugger_command from process heap.
        (init_windows_system_directory): Very early initialize new global
        variable global_progname.
        * dll_init.cc (dll_list::alloc): Make path buffer static.  Explain why.
        (dll_list::populate_deps): Use tmp_pathbuf for local path buffer.
        * exceptions.cc (debugger_command): Convert to PWCHAR.
        (error_start_init): Allocate debugger_command and fill with wide char
        strings.  Only allocate if NULL.
        (try_to_debug): Just check if debugger_command is a NULL pointer to
        return.  Drop conversion from char to WCHAR and drop local variable
        dbg_cmd.
        * globals.cc (global_progname): New global variable to store Windows
        application path.
        * pinfo.cc (pinfo_basic::pinfo_basic): Just copy progname over from
        global_progname.
        (pinfo::status_exit): Let path_conv create the POSIX path to
        avoid local buffer.
        * pseudo_reloc.cc (__report_error): Utilize global_progname, drop local
        buffer.
        * smallprint.cc (__small_vsprintf): Just utilize global_progname for
        %P format specifier.
        (__small_vswprintf): Ditto.
        * strace.cc (PROTECT): Change to reflect x being a pointer.  Reformat.
        (CHECK): Ditto.  Reformat.
        (strace::activate): Utilize global_progname, drop local buffer.
        Fix formatting.
        (strace::vsprntf): Reduce size of local progname buffer to NAME_MAX.
        Copy and, if necessary, convert only the last path component to
        progname.
        (strace_buf_guard): New muto.
        (buf): New static pointer.
        (strace::vprntf): Use buf under strace_buf_guard lock only.  Allocate
        buffer space for buf on Windows heap.
        * wow64.cc (wow64_respawn_process): Utilize global_progname, drop
        local path buffer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRemove x86_64 __sjfault/__ljfault
Corinna Vinschen [Sat, 18 Jul 2015 12:48:32 +0000 (14:48 +0200)]
Remove x86_64 __sjfault/__ljfault

* gendef: Remove unused 64 bit versions of __sjfault and __ljfault.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRearrange makecontext and add lots of comments
Corinna Vinschen [Sat, 18 Jul 2015 10:35:23 +0000 (12:35 +0200)]
Rearrange makecontext and add lots of comments

        * exceptions.cc (makecontext): Rearrange order of initialization and
        document at great length.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix ucontext creation in call_signal handler
Corinna Vinschen [Fri, 17 Jul 2015 16:29:52 +0000 (18:29 +0200)]
Fix ucontext creation in call_signal handler

        * exceptions.cc (__unwind_single_frame): Define empty macro on i686.
        (_cygtls::call_signal_handler): Try to make sure signal context makes
        sense in case we're generating context here.  Add comment to explain.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoComment fixup
Corinna Vinschen [Fri, 17 Jul 2015 14:47:14 +0000 (16:47 +0200)]
Comment fixup

        * exceptions.cc (getcontext/x86_64): Drop comment on RtlCaptureContext.
        (swapcontext/x86_64): Fix comment yet again.
        (getcontext/i686): Move comment from x86_64 getcontext, slightly
        rearranged, to preceeding comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoReuse __unwind_single_frame where appropriate
Corinna Vinschen [Fri, 17 Jul 2015 14:29:41 +0000 (16:29 +0200)]
Reuse __unwind_single_frame where appropriate

        * exceptions.cc (__unwind_single_frame): Move up in file to be
        accessible from other places.  Move comment to getcontext.
        (stack_info::walk): Call __unwind_single_frame in 64 bit case.  Fix
        preceeding comment.
        (myfault_altstack_handler): Call __unwind_single_frame.
        (getcontext): Give comment from __unwind_single_frame a new home.
        (swapcontext): Fix comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoImplement getcontext, setcontext, makecontext, swapcontext
Corinna Vinschen [Fri, 17 Jul 2015 12:31:12 +0000 (14:31 +0200)]
Implement getcontext, setcontext, makecontext, swapcontext

        * common.din (getcontext): Export.
        (makecontext): Export.
        (setcontext): Export.
        (swapcontext): Export.
        * exceptions.cc (__unwind_single_frame): New static functions, 64 bit
        only.
        (setcontext): New function.
        (getcontext): New function.
        (swapcontext): New function.
        (__cont_link_context): New function.
        (makecontext): New function.
        * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2002.
        (CYGWIN_VERSION_API_MINOR): Bump.
        * include/ucontext.h (getcontext): Add prototype.
        (setcontext): Ditto.
        (swapcontext): Ditto.
        (makecontext): Ditto.
        * ntdll.h (NtContinue): Ditto.

        * new-features.xml (ov-new2.2): Add new section.  Document getcontext,
        setcontext, makecontext, swapcontext.
        * posix.xml (std-deprec): Add getcontext, setcontext, makecontext,
        swapcontext.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDocument the fact that we forgot to bump for sigaltstack and sethostname
Corinna Vinschen [Fri, 17 Jul 2015 12:02:43 +0000 (14:02 +0200)]
Document the fact that we forgot to bump for sigaltstack and sethostname

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years ago[AArch64] Reverting recent optimized memset().
Marcus Shawcroft [Wed, 15 Jul 2015 12:34:58 +0000 (13:34 +0100)]
[AArch64] Reverting recent optimized memset().

9 years agoChange to nano.specs to add nano's include dir cygwin-2_1_0-release
Andre Simoes Dias Vieira [Mon, 29 Jun 2015 12:38:59 +0000 (13:38 +0100)]
Change to nano.specs to add nano's include dir

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoexceptions.cc: Reenable code only disabled for debug purposes
Corinna Vinschen [Mon, 13 Jul 2015 14:08:29 +0000 (16:08 +0200)]
exceptions.cc: Reenable code only disabled for debug purposes

* exceptions.cc (exception::handle): Reenable code only disabled for
debug purposes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years ago[AArch64] Optimized memset.
Wilco Dijkstra [Mon, 13 Jul 2015 12:13:34 +0000 (13:13 +0100)]
[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.

9 years agoFix ChangeLog entry for previous two commits.
Marcus Shawcroft [Mon, 13 Jul 2015 12:17:04 +0000 (13:17 +0100)]
Fix ChangeLog entry for previous two commits.

9 years ago[AArch64] Optimized memcpy.
Wilco Dijkstra [Mon, 13 Jul 2015 12:09:02 +0000 (13:09 +0100)]
[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.

9 years ago[AArch64] Optimized memmove.
Wilco Dijkstra [Mon, 13 Jul 2015 12:03:02 +0000 (13:03 +0100)]
[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.

9 years agoFix typo in README.
Jeff Johnston [Fri, 10 Jul 2015 20:49:40 +0000 (16:49 -0400)]
Fix typo in README.

9 years agotzset: Check timezone and country case-insensitive
Corinna Vinschen [Wed, 8 Jul 2015 08:25:49 +0000 (10:25 +0200)]
tzset: Check timezone and country case-insensitive

        * tzset.c (main): Check timezone and country case-insensitive.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd accidentally missing ChangeLog entry for previous patch
Corinna Vinschen [Tue, 7 Jul 2015 18:49:02 +0000 (20:49 +0200)]
Add accidentally missing ChangeLog entry for previous patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agox86_64: Handle myfault exceptions when running on alternate signal stack
Corinna Vinschen [Tue, 7 Jul 2015 18:45:06 +0000 (20:45 +0200)]
x86_64: Handle myfault exceptions when running on alternate signal stack

        x86_64 only:
        * cygtls.cc (san::leave): Restore _my_tls.andreas.
        * cygtls.h (class san):  Add _clemente as in 32 bit case.  Add ret and
        frame members.
        (san::san): Handle _my_tls.andreas as on 32 bit.  Take parameter and
        write it to new member ret.  Store current stack pointer in frame.
        (san::~san): New destructor to restore _my_tls.andreas.
        (__try): Use __l_except address as parameter to san::san.
        * dcrt0.cc (dll_crt0_0): Add myfault_altstack_handler as vectored
        continuation handler.
        * exception.h (myfault_altstack_handler): Declare.
        * exceptions.cc (myfault_altstack_handler): New function.  Explain what
        it's good for.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSimplify stack allocation code in child after fork
Corinna Vinschen [Tue, 7 Jul 2015 15:24:37 +0000 (17:24 +0200)]
Simplify stack allocation code in child after fork

        * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
        (child_info_fork::alloc_stack_hard_way): Drop declaration.
        * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fold into
        child_info_fork::alloc_stack.
        (getstack): Remove.
        (child_info_fork::alloc_stack): Simplify check for application-provided
        stack in "hard way" code.  Don't call getstack for each page, just
        reallocate stack immediately as required.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSimplify fork code setting up child stack info
Corinna Vinschen [Tue, 7 Jul 2015 15:05:20 +0000 (17:05 +0200)]
Simplify fork code setting up child stack info

        * fork.cc (frok::parent): Simplify code propagating stack setup to
        child process.  Tweak comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agowinsup/cygwin: rework basename redefinition handling in path.cc
Yaakov Selkowitz [Mon, 6 Jul 2015 20:17:17 +0000 (15:17 -0500)]
winsup/cygwin: rework basename redefinition handling in path.cc

This fixes the compile after commit 79e419de6261c4e04785908828096cb4d56b8680.

* path.cc: Rework basename redefinition handling.  Explain why.

9 years agoRework handling of basename variants
Yaakov Selkowitz [Mon, 6 Jul 2015 19:58:51 +0000 (14:58 -0500)]
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.

9 years agoFix sys/time.h build problem due to inconsistent macro usage
Corinna Vinschen [Mon, 6 Jul 2015 12:08:30 +0000 (14:08 +0200)]
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>
9 years agowinsup/doc: Add a configure test to find docbook2xtexi
Jon TURNEY [Sun, 5 Jul 2015 18:09:16 +0000 (19:09 +0100)]
winsup/doc: Add a configure test to find docbook2xtexi

Fedora installs docbook2texi under the name db2x_docbook2texi
Other distros and Cygwin install docbook2texi under the name docbook2x-texi

Add a configure test to find either.

2015-07-05  Jon Turney  <jon.turney@dronecode.org.uk>

* configure.ac: Add check for DOCBOOK2XTEXI
* configure: Regenerate.
* Makefile.in (DOCBOOK2XTEXI): Use.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoAlign hard stack allocation to pthread stack setup changes
Corinna Vinschen [Sun, 5 Jul 2015 15:45:06 +0000 (17:45 +0200)]
Align hard stack allocation to pthread stack setup changes

* dcrt0.cc (CYGWIN_GUARD): Remove.
(child_info_fork::alloc_stack_hard_way): Align stack commit to changes
of thread stack setup in CygwinCreateThread.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoImplement correct RLIMIT_STACK handling
Corinna Vinschen [Sun, 5 Jul 2015 13:51:37 +0000 (15:51 +0200)]
Implement correct RLIMIT_STACK handling

        * miscfuncs.cc (struct pthread_wrapper_arg): Add member guardsize.
        (pthread_wrapper): Set thread stack guarantee according to guardsize.
        Tweak assembler code so that $rax/$eax is not required by GCC to
        prepare the wrapper_arg value.
        (CygwinCreateThread): Fix deadzone handling.  Drop setting a "POSIX"
        guardpage (aka page w/ PAGE_NOACCESS).  Always use Windows guard
        pages instead.  On post-XP systems (providing SetThreadStackGuarantee)
        always set up stack Windows like with reserved/commited areas and
        movable guard pages.  Only on XP set up stack fully commited if the
        guardpage size is not the default system guardpage size.
        Fill out pthread_wrapper_arg::guardsize.  Improve comments.
        * resource.cc: Implement RSTACK_LIMIT Linux-like.
        (DEFAULT_STACKSIZE): New macro.
        (DEFAULT_STACKGUARD): Ditto.
        (rlimit_stack_guard): New muto.
        (rlimit_stack): New global variable holding current RSTACK_LIMIT values.
        (__set_rlimit_stack): Set rlimit_stack under lock.
        (__get_rlimit_stack): Initialize rlimit_stack from executable header
        and return rlimit_stack values under lock.
        (get_rlimit_stack): Filtering function to return useful default
        stacksize from rlimit_stack.rlim_cur value.
        (getrlimit): Call __get_rlimit_stack in RLIMIT_STACK case.
        (setrlimit): Call __set_rlimit_stack in RLIMIT_STACK case.
        * thread.cc (pthread::create): Fetch default stacksize calling
        get_rlimit_stack.
        (pthread_attr::pthread_attr): Fetch default guardsize calling
        wincap.def_guard_page_size.
        (pthread_attr_getstacksize): Fetch default stacksize calling
        get_rlimit_stack.
        * thread.h (PTHREAD_DEFAULT_STACKSIZE): Remove.
        (PTHREAD_DEFAULT_GUARDSIZE): Remove.
        (get_rlimit_stack): Declare.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDisable fetching heap info on 64 bit XP/2003
Corinna Vinschen [Sun, 5 Jul 2015 10:51:52 +0000 (12:51 +0200)]
Disable fetching heap info on 64 bit XP/2003

        * fhandler_process.cc (heap_info::heap_info): Disable fetching heap info
        on 64 bit XP/2003.  Explain why.
        * wincap.h (wincaps::has_broken_rtl_query_process_debug_information):
        New element.
        * wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd missing wincap changes to previous ChangeLog entry
Corinna Vinschen [Sun, 5 Jul 2015 10:48:05 +0000 (12:48 +0200)]
Add missing wincap changes to previous ChangeLog entry

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix original stack when running signal handler on alternate stack
Corinna Vinschen [Sat, 4 Jul 2015 20:49:30 +0000 (22:49 +0200)]
Fix original stack when running signal handler on alternate stack

        * autoload.cc (SetThreadStackGuarantee): Import.
        * cygtls.h (struct _cygtls): Replace thread_context with a ucontext_t
        called context.
        * exceptions.cc (exception::handle): Exit from process via signal_exit
        in case sig_send returns from handling a stack overflow SIGSEGV.
        Explain why.
        (dumpstack_overflow_wrapper): Thread wrapper to create a stackdump
        from another thread.
        (signal_exit): Fix argument list to reflect three-arg signal handler.
        In case we have to create a stackdump for a stack overflow condition,
        do so from a separate thread.  Explain why.
        (sigpacket::process): Don't run signal_exit on alternate stack.
        (altstack_wrapper): Wrapper function to do stack correction when
        calling the signal handler on an alternate stack to handle a stack
        overflow.  Make sure to have lots of comments.
        (_cygtls::call_signal_handler): Drop local context variable to reduce
        stack pressure.  Use this->context instead.  Change inline assembler
        to call altstack_wrapper.
        (_cygtls::signal_debugger): Accommodate aforementioned change to
        struct _cygtls.
        * tlsoffset.h: Regenerate.
        * tlsoffset64.h: Regenerate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoPrevent use of uninitialized file lock
Sebastian Huber [Wed, 1 Jul 2015 13:35:00 +0000 (15:35 +0200)]
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>
9 years agoDocument previous change
Corinna Vinschen [Wed, 1 Jul 2015 13:50:18 +0000 (15:50 +0200)]
Document previous change

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix fork after recovered stack overflow
Corinna Vinschen [Wed, 1 Jul 2015 13:28:16 +0000 (15:28 +0200)]
Fix fork after recovered stack overflow

* fork.cc (frok::parent): Set stacktop value based on requested stack
pointer value in child.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd comment to sigaltstack to explain setting ss_flags here
Corinna Vinschen [Tue, 30 Jun 2015 18:43:50 +0000 (20:43 +0200)]
Add comment to sigaltstack to explain setting ss_flags here

* signal.cc (sigaltstack): Add comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRegenerate Makefile.in
Jon TURNEY [Mon, 29 Jun 2015 11:24:04 +0000 (12:24 +0100)]
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>
9 years agoHandle ss_flags value longjmp safe.
Corinna Vinschen [Sat, 27 Jun 2015 10:08:07 +0000 (12:08 +0200)]
Handle ss_flags value longjmp safe.

* exceptions.cc (_cygtls::call_signal_handler): Drop manipulating
thread's ss_flags here.  It's not safe against longjmp.
* signal.cc (sigaltstack): Check if we're running on the alternate
stack and set ss_flags returned in oss to SS_ONSTACK.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDefine larger MINSIGSTKSZ and SIGSTKSZ values for Cygwin
Corinna Vinschen [Fri, 26 Jun 2015 19:41:26 +0000 (21:41 +0200)]
Define larger MINSIGSTKSZ and SIGSTKSZ values for Cygwin

* include/cygwin/signal.h: Revert to define MINSIGSTKSZ and SIGSTKSZ
here with bigger values to allow _cygtls to reside on signal stack,
should it turn out to be required at one point.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix values returned by getrlimit(RLIMIT_STACK)
Corinna Vinschen [Fri, 26 Jun 2015 18:41:54 +0000 (20:41 +0200)]
Fix values returned by getrlimit(RLIMIT_STACK)

* resource.cc (getrlimit): Fix values returned by RLIMIT_STACK.
Explain why this had to be changed.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUse source files which have makedoc markup, but aren't processed or included. newlib-snapshot-20150623
Jon TURNEY [Tue, 23 Jun 2015 13:35:00 +0000 (14:35 +0100)]
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>
9 years agoUse makedoc output files which are generated but aren't included
Jon TURNEY [Tue, 23 Jun 2015 13:10:14 +0000 (14:10 +0100)]
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>
9 years agoDon't chew files which contain no documentation markup
Jon TURNEY [Tue, 16 Jun 2015 10:52:10 +0000 (11:52 +0100)]
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>
9 years agoFix mismatched parentheses in documentation.
Jon TURNEY [Thu, 18 Jun 2015 12:38:12 +0000 (13:38 +0100)]
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>
9 years agoFix typo-ed function names in efgcvt.c documentation
Jon TURNEY [Tue, 23 Jun 2015 11:43:51 +0000 (12:43 +0100)]
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>
9 years agoFix an inconsistent use of '.' in FUNCTION
Jon TURNEY [Tue, 23 Jun 2015 12:02:33 +0000 (13:02 +0100)]
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>
9 years agoFix SYNOPSIS prototypes without marked up parameter names
Jon TURNEY [Tue, 23 Jun 2015 12:00:57 +0000 (13:00 +0100)]
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>
9 years agoCorrect a non-ANSI prototype in SYNOPSIS
Jon TURNEY [Tue, 23 Jun 2015 12:02:18 +0000 (13:02 +0100)]
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>
9 years agoRemove stray punctuation in ANSI_SYNOPSIS prototypes
Jon TURNEY [Tue, 23 Jun 2015 14:53:51 +0000 (15:53 +0100)]
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>
9 years agoFix some mangled makedoc markup
Jon TURNEY [Tue, 23 Jun 2015 15:12:05 +0000 (16:12 +0100)]
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>
9 years agoFix makedoc markup used in texinfo source
Jon TURNEY [Tue, 23 Jun 2015 11:56:24 +0000 (12:56 +0100)]
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>
9 years agowinsup/doc: Update ancient README about building documentation
Jon TURNEY [Tue, 16 Jun 2015 17:26:08 +0000 (18:26 +0100)]
winsup/doc: Update ancient README about building documentation

Update list of pre-requisites, everything else is obsolete.

Future work: Ensure that the list of pre-requisites in FAQ 6.21 "How do I build
Cygwin" remains synchronized with this list.

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

* README: Update.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Use xidepend to generate the source list for FAQ targets as well
Jon TURNEY [Tue, 16 Jun 2015 17:18:11 +0000 (18:18 +0100)]
winsup/doc: Use xidepend to generate the source list for FAQ targets as well

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

* Makefile.in (FAQ_SOURCES): Remove and generate with xidepend.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Remove 'Usage' prefix from synopses
Jon TURNEY [Fri, 12 Jun 2015 09:56:47 +0000 (10:56 +0100)]
winsup/doc: Remove 'Usage' prefix from synopses

Remove redundant 'Usage' prefix from synopses.

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

* utils.xml: Remove 'Usage' prefix from synopses.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Add intro man pages from cygwin-doc
Jon TURNEY [Mon, 22 Jun 2015 13:58:09 +0000 (14:58 +0100)]
winsup/doc: Add intro man pages from cygwin-doc

v2:
intro.1 and cygwin.1 are identical. Make cygwin.1 a link to intro.1
Update dates in static man pages

v3:
Use doclifter to convert intro.[13] to DocBook XML
Clean up markup and fix a couple of spelling mistakes.
Build and install manpages from XML

v4:
Update to refer to GPLv3+, SUSv4
Simplify ulinks where anchor text is the same as the URL

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

* Makefile.in (intro2man.stamp): Add.
* intro.xml: New file.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Create info pages from cygwin documentation
Jon TURNEY [Wed, 11 Mar 2015 13:50:51 +0000 (13:50 +0000)]
winsup/doc: Create info pages from cygwin documentation

v2:
Updated to use docbook2x-texi not docbook2texi, since source is now docbook XML.
Tweak DocBook XML so info directory entry has a description.

v3:
Use a custom charmap to handle &reg;

v4:
Proper build avoidance
texinfo node references may not contain ':', so provide alternate text for a few
xref targets

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

* Makefile.in (install-info, cygwin-ug-net.info)
(cygwin-api.info): Add.
* cygwin-ug-net.xml: Add texinfo-node.
* cygwin-api.xml: Ditto.
* ntsec.xml (db_home): Add texinfo-node for titles containing a
':' which are the targets of an xref.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoComplement SIGEV_* enums with macros
Ken Brown [Tue, 23 Jun 2015 08:39:06 +0000 (10:39 +0200)]
Complement SIGEV_* enums with macros

* include/cygwin/signal.h (SIGEV_*): Add macros.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDon't push on original stack during alternate signal stack setup
Corinna Vinschen [Mon, 22 Jun 2015 11:09:55 +0000 (13:09 +0200)]
Don't push on original stack during alternate signal stack setup

* exceptions.cc (_cygtls::call_signal_handler): Drop pushing a register
on the original stack, it confuses GCC.  Rearrange the assembler code
so that $rax/$eax is not used by GCC to prepare an argument value.
Use $rax/$eax without saving.  Drop clearing $rbp/$epb.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agosys/signal.h requires sys/cdefs.h
Corinna Vinschen [Mon, 22 Jun 2015 08:49:29 +0000 (10:49 +0200)]
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>
9 years agoSafe all clobbered volatile registers when using alternate stack
Corinna Vinschen [Sun, 21 Jun 2015 11:58:57 +0000 (13:58 +0200)]
Safe all clobbered volatile registers when using alternate stack

* exceptions.cc (_cygtls::call_signal_handler): Drop subtracting 16
bytes from the alternate stack, it's not necessary.  Safe all clobbered
registers.  Safe one on the orignal stack, the others on the alternate
stack on both platforms.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix comments
Corinna Vinschen [Sat, 20 Jun 2015 18:56:55 +0000 (20:56 +0200)]
Fix comments

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoChangeLog entries for Cygwin's alternate signal stack implementation
Corinna Vinschen [Sat, 20 Jun 2015 18:36:16 +0000 (20:36 +0200)]
ChangeLog entries for Cygwin's alternate signal stack implementation

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd alternate signal stack to docs
Corinna Vinschen [Sat, 20 Jun 2015 18:30:17 +0000 (20:30 +0200)]
Add alternate signal stack to docs

* new-features.xml (ov-new2.1): Add alterante signal stack info.
* posix.xml (std-susv4): Move sigaltstack here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoImplement using alternate signal stack in Cygwin
Corinna Vinschen [Sat, 20 Jun 2015 18:21:02 +0000 (20:21 +0200)]
Implement using alternate signal stack in Cygwin

* exceptions.cc (_cygtls::call_signal_handler): Implement alternate
signal stack handling.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUse MINSIGSTKSZ and SIGSTKSZ from newlib for Cygwin as well
Corinna Vinschen [Sat, 20 Jun 2015 17:05:51 +0000 (19:05 +0200)]
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>
9 years agoHandle exceptions in sigaltstack
Corinna Vinschen [Sat, 20 Jun 2015 16:48:09 +0000 (18:48 +0200)]
Handle exceptions in sigaltstack

* signal.cc (sigaltstack): Add fault handler.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoPreliminary infrastructure to implement alternate stack
Corinna Vinschen [Fri, 19 Jun 2015 13:58:23 +0000 (15:58 +0200)]
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>
9 years agoFormatting fixes in exceptions.cc
Corinna Vinschen [Fri, 19 Jun 2015 14:12:10 +0000 (16:12 +0200)]
Formatting fixes in exceptions.cc

* Makefile.in (install-man): Exclude release subdir from search paths.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agowinsup/doc: Fix command to create man3 install directory
Jon TURNEY [Thu, 18 Jun 2015 12:16:01 +0000 (13:16 +0100)]
winsup/doc: Fix command to create man3 install directory

Fix a cut and paste error in the command to create the man3 install directory,
added in 94f16969

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

* Makefile.in (install-man): Fix command to create man3 install
directory.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoDisallow installing "man pages" from release subdir
Corinna Vinschen [Thu, 18 Jun 2015 20:04:58 +0000 (22:04 +0200)]
Disallow installing "man pages" from release subdir

* Makefile.in (install-man): Exclude release subdir from search paths.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agowinsup/doc: Add man.xsl customization stylesheet
Jon TURNEY [Fri, 12 Jun 2015 20:26:32 +0000 (21:26 +0100)]
winsup/doc: Add man.xsl customization stylesheet

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

* man.xsl: New file.
* Makefile.in (utils2man.stamp, api2man.stamp): Use it.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Make and install cygwin-api function manpages
Jon TURNEY [Tue, 16 Jun 2015 17:55:38 +0000 (18:55 +0100)]
winsup/doc: Make and install cygwin-api function manpages

Use 'xmlto man' to make manpages for utils

This will generate multiple .1 files as an output, but we don't know what they
will be called, so use a timestamp for build avoidance

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

* Makefile.in (api2man.stamp): Add rules to build and install
manpages for cygwin-api.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Convert cygwin-api function documentation to refentry elements
Jon TURNEY [Tue, 16 Jun 2015 17:52:37 +0000 (18:52 +0100)]
winsup/doc: Convert cygwin-api function documentation to refentry elements

Convert cygwin-api from using a sect2 element to using a refentry element for
each function.  This makes it possible to generate manpage-style output for
those elements.

Note that the chunked html now generates a page for each function, rather than
one containing all functions.

Also:

Remove pointless and incorrect date

Move introductory paragraph from the first section to the start of the chapter

Add a funcsynopsisinfo element with the header file to be included to each
function prototype

Remove extern "C" which doesn't process into all formats successfully

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

* cygwin-api.xml: Move introductory paragraph here.
* logon-funcs.xml: Convert from using a sect2 element to using a
refentry element for each function.
* misc-funcs.xml: Ditto.
* path.xml: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agowinsup/doc: Generate ANSI rather than K&R style function prototypes
Jon TURNEY [Tue, 16 Jun 2015 17:40:29 +0000 (18:40 +0100)]
winsup/doc: Generate ANSI rather than K&R style function prototypes

Since K&R style prototypes appear to be the default for HTML and FO, customize
the stylesheets rendering of funcsynopsis elements to generate ANSI style
prototypes instead.

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

* fo.xsl: Render funcsynopsis elements as ANSI style function
prototypes.
* html.xsl: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This page took 0.077971 seconds and 5 git commands to generate.