[LTP] [PATCH v3 3/7] lib/tst_safe_pidfd: Add SAFE_PIDFD_OPEN macro
Cyril Hrubis
chrubis@suse.cz
Wed Feb 23 14:28:29 CET 2022
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?
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list