Hi Thiago, On Sun, 2024-06-30 at 09:49 -0700, Thiago Macieira wrote: > > + True if line is busy. > > + > > + Line can be used by gpio-manager, another user-space process, a > > kernel + driver or is hogged. The exact reason a line is busy cannot > > be determined + from user-space unless it's known to be managed by > > gpio-manager (see: + the Managed property of this interface). > > + --> > > + <property name='Used' type='b' access='read'/> > > What's the point of this property? It looks racy, as the user (whichever it > is) can stop using it soon after a true read, or the line can become used > right after a false read? The latter could lead to TOCTOU problems. > > Wouldn't it be better to force users to RequestLine and get an error if the > line is busy? Because if it wasn't busy, now the calling application knows > nothing else can grab it. this approach would make the inspection itself racy, isn't it? I'm thinking about two instances of "gpiocli info" running in parallel, they would display GPIO lines randomly "busy" even in case none of them actually is? -- Alexander Sverdlin Siemens AG www.siemens.com