Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190806130129.GU9017@brightrain.aerifal.cx>
Date: Tue, 6 Aug 2019 09:01:29 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 2/2] fix risc64 user_regs_struct conflict with
 kernel header

On Tue, Aug 06, 2019 at 03:15:47PM +0300, Baruch Siach wrote:
> Hi Rick,
> 
> On Tue, Aug 06 2019, Rich Felker wrote:
> > On Tue, Aug 06, 2019 at 08:51:14AM +0300, Baruch Siach wrote:
> >> Rename user_regs_struct following the example of s390 to avoid conflict
> >> with the kernel asm/ptrace.h header.
> >> ---
> >>  arch/riscv64/bits/user.h | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >> 
> >> diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h
> >> index bd0f0fc7027f..097c7ad6ce18 100644
> >> --- a/arch/riscv64/bits/user.h
> >> +++ b/arch/riscv64/bits/user.h
> >> @@ -1,4 +1,4 @@
> >> -struct user_regs_struct {
> >> +struct _user_regs_struct {
> >>  	unsigned long pc;
> >>  	unsigned long ra;
> >>  	unsigned long sp;
> >
> > Does this agree with glibc naming?
> 
> glibc riscv headers do not define user_regs_struct.

Not even by including a kernel header that defines it? If so, then the
public type must be the same as the type in the kernel header. This is
a known issue in user.h and related headers on several archs, and it's
hard to solve in any reasonable and consistent way short of doing the
same thing (including the kernel header). Renaming the type in a way
that makes the API incompatible is not the right solution.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.