lkml.org 
[lkml]   [2024]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/9] rust: cred: add Rust abstraction for `struct cred`
On 19.01.24 10:52, Alice Ryhl wrote:
> On Fri, Jan 19, 2024 at 10:37 AM Benno Lossin <benno.lossin@proton.me> wrote:
>> On 1/18/24 15:36, Alice Ryhl wrote:
>>> + /// Returns the effective UID of the given credential.
>>> + pub fn euid(&self) -> bindings::kuid_t {
>>> + // SAFETY: By the type invariant, we know that `self.0` is valid.
>>
>> Is `euid` an immutable property, or why does this memory access not race
>> with something?
>
> Yes. These properties are changed by replacing the credential, so the
> credentials themselves are immutable.

I see that's good to know, I think that should be mentioned
on the docs of `Credential`.

--
Cheers,
Benno



\
 
 \ /
  Last update: 2024-05-27 14:32    [W:1.852 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site