[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e2e0a59-587a-4ef3-96e1-8542103dd9d6@rbox.co>
Date: Fri, 26 Jul 2024 22:37:14 +0200
From: Michal Luczaj <mhal@...x.co>
To: Jakub Sitnicki <jakub@...udflare.com>
Cc: Andrii Nakryiko <andrii@...nel.org>, Eduard Zingerman
<eddyz87@...il.com>, Mykola Lysenko <mykolal@...com>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Shuah Khan <shuah@...nel.org>,
bpf@...r.kernel.org, netdev@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH bpf 6/6] selftest/bpf: Introduce __attribute__((cleanup))
in create_pair()
On 7/26/24 19:27, Jakub Sitnicki wrote:
> On Wed, Jul 24, 2024 at 01:32 PM +02, Michal Luczaj wrote:
>> +#define take_fd(fd) \
>> + ({ \
>> + __auto_type __val = (fd); \
>> + fd = -EBADF; \
>> + __val; \
>> + })
>
> Probably should operate on a pointer to fd to avoid side effects, like
> __get_and_null macro in include/linux/cleanup.h. take_fd is effectively
> __get_and_null(fd, -EBADFD).
> [...]
OK, I'll just make use of stuff from cleanup.h.
Powered by blists - more mailing lists