Skip to contentSkip to conversation

Replace 'struct siginfo' with 'siginfo_t'.

PATCH In review Richard W.M. Jones 2 participants 5 messages Jul 5, 2012 – Jul 9, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Replace 'struct siginfo' with 'siginfo_t'.

From: "Richard W.M. Jones" <[email protected]>

glibc 2.16 will remove the undocumented definition of 'struct siginfo' from <bits/siginfo.h>.

This change is already present in glibc 2.15.90, so qemu compilation of certain targets (eg. cris-user) breaks.

This struct was always typedef'd to be the same as 'siginfo_t' which is what POSIX documents, so use that instead.

---
 linux-user/signal.c |    8 ++++----
 user-exec.c         |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
linux-user/signal.c +4 -4
index 43346dc..108dff9 100644
@@ -2849,7 +2849,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
     * Arguments to signal handler:
     *
     *   a0 = signal number
-    *   a1 = pointer to struct siginfo
+    *   a1 = pointer to siginfo_t
     *   a2 = pointer to struct ucontext
     *
     * $25 and PC point to the signal handler, $29 points to the
@@ -3255,7 +3255,7 @@ struct target_signal_frame {
 };
 
 struct rt_signal_frame {
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
     uint32_t tramp[2];
 };
@@ -3474,9 +3474,9 @@ struct target_signal_frame {
 };
 
 struct rt_signal_frame {
-        struct siginfo *pinfo;
+        siginfo_t *pinfo;
         void *puc;
-        struct siginfo info;
+        siginfo_t info;
         struct ucontext uc;
         uint8_t retcode[8];       /* Trampoline code. */
 };
user-exec.c +1 -1
index b2a4261..1a9c276 100644
@@ -588,7 +588,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
 int cpu_signal_handler(int host_signum, void *pinfo,
                        void *puc)
 {
-    struct siginfo *info = pinfo;
+    siginfo_t *info = pinfo;
     struct ucontext *uc = puc;
     unsigned long pc = uc->uc_mcontext.sc_iaoq[0];
     uint32_t insn = *(uint32_t *)pc;
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Richard W.M. Jones

From: "Richard W.M. Jones" <[email protected]>

glibc 2.16 will remove the undocumented definition of 'struct siginfo' from <bits/siginfo.h>.

Progress marches on, trampling all in its wake.

Quoted 7 lines

This change is already present in glibc 2.15.90, so qemu compilation of certain targets (eg. cris-user) breaks.

This struct was always typedef'd to be the same as 'siginfo_t' which is what POSIX documents, so use that instead.

-- PMM

#2 lore raw
Quoted 7 lines · Peter Maydell
Quoted 4 lines · Richard W.M. Jones

From: "Richard W.M. Jones" <[email protected]>

glibc 2.16 will remove the undocumented definition of 'struct siginfo' from <bits/siginfo.h>.

Progress marches on, trampling all in its wake.

Hey, don't shoot the messenger :-)

Quoted 9 lines
Quoted 7 lines

This change is already present in glibc 2.15.90, so qemu compilation of certain targets (eg. cris-user) breaks.

This struct was always typedef'd to be the same as 'siginfo_t' which is what POSIX documents, so use that instead.

Thanks,

Rich.

Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
#3 lore raw
In reply to Richard W.M. Jones
Quoted 67 lines · Richard W.M. Jones

From: "Richard W.M. Jones" <[email protected]>

glibc 2.16 will remove the undocumented definition of 'struct siginfo' from <bits/siginfo.h>.

This change is already present in glibc 2.15.90, so qemu compilation of certain targets (eg. cris-user) breaks.

This struct was always typedef'd to be the same as 'siginfo_t' which is what POSIX documents, so use that instead.

---
 linux-user/signal.c |    8 ++++----
 user-exec.c         |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
linux-user/signal.c +4 -4
index 43346dc..108dff9 100644
@@ -2849,7 +2849,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
     * Arguments to signal handler:
     *
     *   a0 = signal number
-    *   a1 = pointer to struct siginfo
+    *   a1 = pointer to siginfo_t
     *   a2 = pointer to struct ucontext
     *
     * $25 and PC point to the signal handler, $29 points to the
@@ -3255,7 +3255,7 @@ struct target_signal_frame {
 };
 
 struct rt_signal_frame {
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
     uint32_t tramp[2];
 };
@@ -3474,9 +3474,9 @@ struct target_signal_frame {
 };
 
 struct rt_signal_frame {
-        struct siginfo *pinfo;
+        siginfo_t *pinfo;
         void *puc;
-        struct siginfo info;
+        siginfo_t info;
         struct ucontext uc;
         uint8_t retcode[8];       /* Trampoline code. */
 };
user-exec.c +1 -1
index b2a4261..1a9c276 100644
@@ -588,7 +588,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
 int cpu_signal_handler(int host_signum, void *pinfo,
                        void *puc)
 {
-    struct siginfo *info = pinfo;
+    siginfo_t *info = pinfo;
     struct ucontext *uc = puc;
     unsigned long pc = uc->uc_mcontext.sc_iaoq[0];
     uint32_t insn = *(uint32_t *)pc;
Signature · 1 line
1.7.10.4

Any news on this? Pretty obvious fix if you're using the new glibc ...

Rich.

Signature · 3 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
#4 lore raw
Quoted 6 lines · Richard W.M. Jones
Quoted 5 lines · Richard W.M. Jones

From: "Richard W.M. Jones" <[email protected]>

glibc 2.16 will remove the undocumented definition of 'struct siginfo' from <bits/siginfo.h>.

Quoted 7 lines
Quoted 5 lines

This change is already present in glibc 2.15.90, so qemu compilation of certain targets (eg. cris-user) breaks.

This struct was always typedef'd to be the same as 'siginfo_t' which is what POSIX documents, so use that instead.

Any news on this? Pretty obvious fix if you're using the new glibc ...

4 days would be pretty fast for getting a patch committed, and I think aliguori is either asleep or on holiday this past week or so :-)

-- PMM