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

2024-10-26 Thread Lorenzo Stoakes
On Fri, Oct 25, 2024 at 01:31:49PM -0700, John Hubbard wrote: > On 10/25/24 12:49 PM, Lorenzo Stoakes wrote: > > On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote: > > > On 10/25/24 11:38 AM, Pedro Falcato wrote: > > > > On Fri, Oct 25, 2024 at 6:41 PM John Hubbard > > > > wrote: > ...

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

2024-10-25 Thread Lorenzo Stoakes
On Fri, Oct 25, 2024 at 02:51:29PM -0700, John Hubbard wrote: > On 10/25/24 2:09 PM, Lorenzo Stoakes wrote: > > On Fri, Oct 25, 2024 at 01:31:49PM -0700, John Hubbard wrote: > > > On 10/25/24 12:49 PM, Lorenzo Stoakes wrote: > > > > On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote: > >

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

2024-10-25 Thread John Hubbard
On 10/25/24 2:09 PM, Lorenzo Stoakes wrote: On Fri, Oct 25, 2024 at 01:31:49PM -0700, John Hubbard wrote: On 10/25/24 12:49 PM, Lorenzo Stoakes wrote: On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote: On 10/25/24 11:38 AM, Pedro Falcato wrote: On Fri, Oct 25, 2024 at 6:41 PM John

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

2024-10-25 Thread John Hubbard
On 10/25/24 12:49 PM, Lorenzo Stoakes wrote: On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote: On 10/25/24 11:38 AM, Pedro Falcato wrote: On Fri, Oct 25, 2024 at 6:41 PM John Hubbard wrote: ... That seems to only apply to the kernel internally, uapi headers are Yes. included

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

2024-10-25 Thread Lorenzo Stoakes
On Fri, Oct 25, 2024 at 11:44:34AM -0700, John Hubbard wrote: > On 10/25/24 11:38 AM, Pedro Falcato wrote: > > On Fri, Oct 25, 2024 at 6:41 PM John Hubbard wrote: > > > > > > On 10/25/24 5:50 AM, Pedro Falcato wrote: > > > > On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes > > > > wrote: > > > ..

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

2024-10-25 Thread John Hubbard
On 10/25/24 11:38 AM, Pedro Falcato wrote: On Fri, Oct 25, 2024 at 6:41 PM John Hubbard wrote: On 10/25/24 5:50 AM, Pedro Falcato wrote: On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes wrote: ... +static inline int pidfd_is_self_sentinel(pid_t pid) +{ + return pid == PIDFD_SELF_THRE

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

2024-10-25 Thread Pedro Falcato
On Fri, Oct 25, 2024 at 6:41 PM John Hubbard wrote: > > On 10/25/24 5:50 AM, Pedro Falcato wrote: > > On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes > > wrote: > ... > >> +static inline int pidfd_is_self_sentinel(pid_t pid) > >> +{ > >> + return pid == PIDFD_SELF_THREAD || pid == PIDFD_SE

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

2024-10-25 Thread John Hubbard
On 10/25/24 5:50 AM, Pedro Falcato wrote: On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes wrote: ... +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 usef

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

2024-10-25 Thread Lorenzo Stoakes
On Fri, Oct 25, 2024 at 01:50:12PM +0100, Pedro Falcato wrote: > On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes > wrote: > > > > It is useful to be able to utilise the pidfd mechanism to reference the > > current thread or process (from a userland point of view - thread group > > leader from the

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

2024-10-25 Thread Pedro Falcato
On Fri, Oct 25, 2024 at 10:41 AM Lorenzo Stoakes wrote: > > It is useful to be able to utilise the pidfd mechanism to reference the > current thread or process (from a userland point of view - thread group > leader from the kernel's point of view). > > Therefore introduce PIDFD_SELF_THREAD to refe

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

2024-10-25 Thread Lorenzo Stoakes
It is useful to be able to utilise the pidfd mechanism to reference the current thread or process (from a userland point of view - thread group leader from the kernel's point of view). Therefore introduce PIDFD_SELF_THREAD to refer to the current thread, and PIDFD_SELF_THREAD_GROUP to refer to the