Thread (16 messages) 16 messages, 3 authors, 2024-10-25

Re: [PATCH v5 2/5] pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process

From: John Hubbard <jhubbard@nvidia.com>
Date: 2024-10-25 17:41:25
Also in: linux-fsdevel, linux-kselftest, linux-mm, lkml

On 10/25/24 5:50 AM, Pedro Falcato wrote:
On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes
[off-list ref] wrote:
...
quoted
+static inline int pidfd_is_self_sentinel(pid_t pid)
+{
+       return pid == PIDFD_SELF_THREAD || pid == PIDFD_SELF_THREAD_GROUP;
+}
Do we want this in the uapi header? Even if this is useful, it might
come with several drawbacks such as breaking scripts that parse kernel
headers (and a quick git grep suggests we do have static inlines in
headers, but in rather obscure ones) and breaking C89:
Let's please not say "C89" anymore, we've moved on! :)

The notes in [1], which is now nearly 2.5 years old, discuss the move to
C11, and specifically how to handle the inline keyword.

I think it's quite clear at this point, that we should not hold up new
work, based on concerns about handling the inline keyword, nor about
C89.

[1] commit e8c07082a810 ("Kbuild: move to -std=gnu11")


thanks,
-- 
John Hubbard

 > <source>:8:8: error: unknown type name 'inline'
 >      8 | static inline int pidfd_is_self_sentinel(pid_t pid)
 >
 > :)
 >
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help