Re: [PATCH linux next] tools headers UAPI: sync linux/taskstats.h for procacct.c
From: Andrew Morton
Date: Wed May 27 2026 - 15:51:37 EST
On Wed, 27 May 2026 21:35:58 +0800 (CST) <wang.yaxin@xxxxxxxxxx> wrote:
> From: Wang Yaxin <wang.yaxin@xxxxxxxxxx>
>
> Background
> ==========
> After commit 9b93f7e32774 ("tools/getdelays: use the static UAPI
> headers from tools/include/uapi"), the Makefile was changed to use
> -I../include/uapi/ instead of -I../../usr/include to ensure tools
> always use the up-to-date UAPI headers.
>
> However, only linux/taskstats.h was added to tools/include/uapi/ in
> commit e5bbb35a07b3 ("tools headers UAPI: sync linux/taskstats.h"),
> but linux/acct.h was missing.
Please let's Cc the author of both of these commits!
> Problem
> =======
> This causes procacct.c to fail to compile with:
>
> procacct.c:234:37: error: 'AGROUP' undeclared (first use in this function)
>
> gcc -I../include/uapi/ getdelays.c -o getdelays
> gcc -I../include/uapi/ procacct.c -o procacct
> procacct.c: In function ‘print_procacct’:
> procacct.c:234:37: error: ‘AGROUP’ undeclared (first use in this function)
> did you mean ‘NOGROUP’?
> 234 | , t->version >= 12 ? (t->ac_flag & AGROUP ? 'P' : 'T') : '?'
> | ^~~~~~
> | NOGROUP
> procacct.c:234:37: note: each undeclared ident
>
> because procacct.c uses the AGROUP macro defined in linux/acct.h.
>
> Solution
> ========
> Add the missing linux/acct.h to complete the static UAPI header set.
It has always annoyed me that we do this by copying the file. I'm
surprised that there isn't a way of using the original file directly.
> Fixes: 9b93f7e32774 ("tools/getdelays: use the static UAPI headers from tools/include/uapi")
>
> ...
>
> --- /dev/null
> +++ b/tools/include/uapi/linux/acct.h
>
> ...
>