[PATCH v2] Decode RUSAGE_THREAD
Dmitry V. Levin
ldv at altlinux.org
Thu Mar 16 14:50:09 UTC 2017
On Thu, Mar 16, 2017 at 04:38:27AM +0300, Dmitry V. Levin wrote:
> On Thu, Mar 16, 2017 at 01:01:40AM +0300, Victor Krapivensky wrote:
> > * xlat/usagewho.in: Add values for existing values, add RUSAGE_THREAD.
> > * tests/getrusage.c: Test decoding of RUSAGE_THREAD.
> > ---
> > tests/getrusage.c | 31 +++++++++++++++++++++++++------
> > xlat/usagewho.in | 7 ++++---
> > 2 files changed, 29 insertions(+), 9 deletions(-)
> [...]
> > +int
> > +main(void)
> > +{
> > + struct rusage *const usage = tail_alloc(sizeof(struct rusage));
>
> The idiom is
> struct rusage *const usage = tail_alloc(sizeof(*usage));
I've just introduced a couple of new macros to make it less error-prone
so the idiom has changed to
TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, usage);
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170316/847445b9/attachment.bin>
More information about the Strace-devel
mailing list