Re: Fix error mapping in gethostname

2015-03-31 Thread Corinna Vinschen
On Mar 31 15:23, Renato Silva wrote: > The gethostname function has a problem where a small buffer size will > not produce an accurate errno. This is because the Windows error is > not being appropriately mapped. This causes programs such as hostname > from coreutils to fail because they are not in

Re: [PATCH] Fix documentation of cygwin_internal()'s return type.

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:50, Jon TURNEY wrote: > * misc-funcs.xml (cygwin_internal): Correct return type. Ouch, yes. Please apply. Thanks for catching. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red

Re: [PATCH 3/3] Add cygwin_internal() operation to convert siginfo_t * to EXCEPTION_RECORD *

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:46, Jon TURNEY wrote: > * external.cc (cygwin_internal): Add operation to convert > siginfo_t * to EXCEPTION_RECORD *. > * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. > * exception.h (cygwin_exception): Add exception_record accessor. > diff --git a/win

Re: [PATCH 1/2] Rename struct ucontext to struct mcontext

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:48, Jon TURNEY wrote: > On 30/03/2015 19:47, Corinna Vinschen wrote: > >Just for the records what we talked about on IRC: > > > >On Mar 30 18:32, Jon TURNEY wrote: > >>@@ -45,7 +49,7 @@ struct _fpstate > >>__uint32_t padding[24]; > >> }; > >> > >>-struct ucontext > >>+struct mcont

Re: [PATCH 0/3] Make detailled exception information available to signal handlers

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:46, Jon TURNEY wrote: > Thanks for your help so far. Here's another attempt at this. > > Questions: > > The ContextFlags member of the CONTEXT type is named cr2 in struct > __mcontext. I > don't understand how that can be right. It isn't. Please rename cr2 to ctx_flags and add a

Re: [PATCH 2/3] Make mcontext and stack information available to signal handlers

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:46, Jon TURNEY wrote: > Add ucontext.h header, defining ucontext_t and mcontext_t types. > > Provide sigaction sighandlers with a ucontext_t parameter, containing stack > and > context information. > > XXX: How do we indicate context information is not available (si_cyg == NULL) If

Re: [PATCH 1/3] Rename struct ucontext to struct __mcontext

2015-03-31 Thread Corinna Vinschen
On Mar 31 18:46, Jon TURNEY wrote: > * include/cygwin/signal.h : Rename struct ucontext to struct > __mcontext. Remove unused member _internal. Fix differences from > the Win32 API CONTEXT type. Patch is ok, except for the __COPY_CONTEXT_SIZE part. This requires a change to st

Fix error mapping in gethostname

2015-03-31 Thread Renato Silva
The gethostname function has a problem where a small buffer size will not produce an accurate errno. This is because the Windows error is not being appropriately mapped. This causes programs such as hostname from coreutils to fail because they are not informed about the long name. Changelog entry:

[PATCH] Fix documentation of cygwin_internal()'s return type.

2015-03-31 Thread Jon TURNEY
* misc-funcs.xml (cygwin_internal): Correct return type. --- winsup/doc/ChangeLog | 4 winsup/doc/misc-funcs.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 814e651..b04210f 100644 --- a/winsup/doc/Change

Re: [PATCH 1/2] Rename struct ucontext to struct mcontext

2015-03-31 Thread Jon TURNEY
On 30/03/2015 19:47, Corinna Vinschen wrote: Just for the records what we talked about on IRC: On Mar 30 18:32, Jon TURNEY wrote: @@ -45,7 +49,7 @@ struct _fpstate __uint32_t padding[24]; }; -struct ucontext +struct mcontext __mcontext so as not to pollute the namespace. __uint64

[PATCH 2/3] Make mcontext and stack information available to signal handlers

2015-03-31 Thread Jon TURNEY
Add ucontext.h header, defining ucontext_t and mcontext_t types. Provide sigaction sighandlers with a ucontext_t parameter, containing stack and context information. XXX: How do we indicate context information is not available (si_cyg == NULL) * include/sys/ucontext.h : New header.

[PATCH 0/3] Make detailled exception information available to signal handlers

2015-03-31 Thread Jon TURNEY
Thanks for your help so far. Here's another attempt at this. Questions: The ContextFlags member of the CONTEXT type is named cr2 in struct __mcontext. I don't understand how that can be right. For a non-exception signal, we won't have aCONTEXT to provide. Is one that is all zeroes acceptabl

[PATCH 3/3] Add cygwin_internal() operation to convert siginfo_t * to EXCEPTION_RECORD *

2015-03-31 Thread Jon TURNEY
* external.cc (cygwin_internal): Add operation to convert siginfo_t * to EXCEPTION_RECORD *. * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. * exception.h (cygwin_exception): Add exception_record accessor. --- winsup/cygwin/ChangeLog| 7 +++ w

[PATCH 1/3] Rename struct ucontext to struct __mcontext

2015-03-31 Thread Jon TURNEY
* include/cygwin/signal.h : Rename struct ucontext to struct __mcontext. Remove unused member _internal. Fix differences from the Win32 API CONTEXT type. XXX: the ContextFlags member of the CONTEXT type is named cr2. This looks wrong. --- winsup/cygwin/ChangeLog