[LTP] [PATCH v3 3/7] lib/tst_safe_pidfd: Add SAFE_PIDFD_OPEN macro
xuyang2018.jy@fujitsu.com
xuyang2018.jy@fujitsu.com
Thu Feb 24 08:23:21 CET 2022
Hi Cyril
> Hi!
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>> +/*
>> + * Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
>> + * Author: Yang Xu<xuyang2018.jy@fujitsu.com>
>> + */
>> +
>> +#ifndef TST_SAFE_PIDFD_H__
>> +#define TST_SAFE_PIDFD_H__
>> +
>> +#include<unistd.h>
>> +#include "lapi/pidfd.h"
>> +
>> +int safe_pidfd_open(const char *file, const int lineno, pid_t pid,
>> + unsigned int flags);
>> +
>> +#define SAFE_PIDFD_OPEN(pid, flags) \
>> + safe_pidfd_open(__FILE__, __LINE__, (pid), (flags))
>
> Is there a reason why we start a new header instead of adding this into
> the tst_safe_macros.h?
Just avoid a big tst_safe_macros.h like tst_safe_sysv_ipc.h does.
Also the pidfd related syscalls seems no libc wrapper.
Based on the above two points, I started a new header. Also if you want
to merge it into tst_safe_macros.h, I will do(I don't have objection to
add this into tst_safe_macros.h ).
Best Regards
Yang Xu
>
>
More information about the ltp
mailing list