[LTP] [PATCH v4 1/5] syscalls/clone02: Convert to new API

zhanglianjie zhanglianjie@uniontech.com
Sat Oct 16 15:07:23 CEST 2021


Hi,
This is great, thanks.

在 2021/10/15 17:57, Petr Vorel 写道:
> Hi,
> 
>> +++ b/testcases/kernel/syscalls/clone/clone02.c
> ...
>> +static char *res_name[] = {
>> +	[1] = "CLONE_VM",
>> +	[2] = "CLONE_FS",
>> +	[4] = "CLONE_FILES",
>> +	[8] = "CLONE_SIGHAND",
>>   };
> 
> Not really that important, but you could
> 1) Instead of hardwired indexes use constants from <sched.h>.
> 2) To get their string values with macro stringification.
> 
> #define CLONE_DESC(x) [x] = #x
> 
> static char *res_name[] = {
> 	CLONE_DESC(CLONE_VM),
> 	CLONE_DESC(CLONE_FS),
> 	CLONE_DESC(CLONE_FILES),
> 	CLONE_DESC(CLONE_SIGHAND),
> };
> 
> If this is the only change, it can be replaced during merge.
> 
> Kind regards,
> Petr
> 

-- 
Regards,
Zhang Lianjie




More information about the ltp mailing list