From 5acc81cc976f2c88311811cd58a3e509dc4df2db Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 6 Jul 2026 14:46:07 +0100 Subject: [PATCH] add descriptions to the ftok function and ipc_perm struct members --- src/header/sys_ipc/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/header/sys_ipc/mod.rs b/src/header/sys_ipc/mod.rs index 6a449f2187..55f5ca5081 100644 --- a/src/header/sys_ipc/mod.rs +++ b/src/header/sys_ipc/mod.rs @@ -35,15 +35,26 @@ pub const IPC_PRIVATE: key_t = 0; #[derive(Copy, Clone, Debug)] pub struct ipc_perm { pub __key: key_t, + /// Owner's user ID. pub uid: uid_t, + /// Owner's group ID. pub gid: gid_t, + /// Creator's user ID. pub cuid: uid_t, + /// Creator's group ID. pub cgid: gid_t, + /// Read/write permission. pub mode: mode_t, pub __seq: c_ushort, } /// See . +/// +/// Returns a key based on `path` and `id` that is usable in subsequent calls +/// to `msgget()`, `semget()`, and `shmget()`. +/// +/// Upon success, returns a key. Upon failure, returns `(key_t)-1` and sets +/// errno to indicate the error. #[unsafe(no_mangle)] pub unsafe extern "C" fn ftok(path: *const c_char, id: c_int) -> key_t { let path = unsafe { CStr::from_ptr(path) };