Handle xlat styles when printing rlimit

shankarapailoor shankarapailoor at gmail.com
Sun Feb 17 23:59:51 UTC 2019


Thanks! Attached is an updated patch.

On Sun, Feb 17, 2019 at 3:48 PM Dmitry V. Levin <ldv at altlinux.org> wrote:

> On Sun, Feb 17, 2019 at 03:37:08PM -0800, shankarapailoor wrote:
> > Hi,
> >
> > >setrlimit.c:49:24: error: format '%lx' expects argument of type 'long
> > unsigned int', but argument 2 has type '
> > uint64_t' {aka 'const long long unsigned int'} [-Werror=format=]
> >
> > My compiler (gcc 9.0) says uint64_t is const long unsigned int and
> > complains when I use %llx. I am not too sure what the right thing to do
> > here is my apologies.
>
> It depends on the target architecture.
>
> [...]
> > > > diff --git a/tests/setrlimit.c b/tests/setrlimit.c
> > > > index f199abe1..084e7beb 100644
> > > > --- a/tests/setrlimit.c
> > > > +++ b/tests/setrlimit.c
> > > > @@ -23,7 +23,14 @@ main(void)
> > > >       for (xlat = resources; xlat->str; ++xlat) {
> > > >               unsigned long res = 0xfacefeed00000000ULL | xlat->val;
>
> This means that ...
>
> > > >               long rc = syscall(__NR_setrlimit, res, 0);
> > > > +#if XLAT_RAW
> > > > +             printf("setrlimit(%#lx, NULL) = %s\n", xlat->val,
>
> ... you can cast xlat->val to unsigned int and print it as %#x.
>
>
> --
> ldv
> --
> Strace-devel mailing list
> Strace-devel at lists.strace.io
> https://lists.strace.io/mailman/listinfo/strace-devel
>


-- 
Regards,
Shankara Pailoor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190217/99b7bdd5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4-0001-handle-xlat_styles-when-printing-rlim_cur-rlim_ma.patch
Type: text/x-patch
Size: 8483 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190217/99b7bdd5/attachment.bin>


More information about the Strace-devel mailing list