ipc_addid(9)
π ipc_addid(9) β the Kernel API Manual glow-up
okay so bestie, welcome to ipc_addid from the Kernel API Manual β this is the little kernel function that's literally handing out IPC identifiers like they're friendship bracelets. it's short, it's sweet, and it has opinions about locking. let's get into it π
β¨ SYNOPSIS β¨
int ipc_addid (struct ipc_ids *ids , struct kern_ipc_perm *new , int
limit );
that's it, that's the whole vibe check. she takes three things and returns an int. no cap. π¦
πΈ ARGUMENTS πΈ
idsβ the ipc identifier set, aka the group chat where all the ids livenewβ the new ipc permission set, aka the new member being added to said group chatlimitβ the cap on how many used ids are allowed, because even group chats have a member limit, periodt
π DESCRIPTION π
so what she actually does: you add an entry new to the ipc ids idr. the permissions object gets initialised, the first free entry is set up, and the index that got assigned is returned to you. congrats, that's your new id, slay π
on success the new entry comes back in a locked state β she is holding the lock, it's her main character era, do not disturb π
on failure tho? the entry is not locked, and you get a negative err-code back. read that again. if it fails, the caller must use ipc_rcu_putref to free the identifier. like, that's on you, bestie β don't leave that reference just floating around π
β οΈ big one: this function is called with the writer ipc_ids.rwsem held. that's not a vibe suggestion, that's a requirement. hold the writer lock or the whole thing is giving undefined-behaviour energy π
π SEE ALSO π
the whole friend group, all in the kernel file ./ipc/util.c:
ipc_init(9)ipc_init_ids(9)ipc_init_proc_interface(9)ipc_findkey(9)ipcget_new(9)ipc_check_perms(9)ipcget_public(9)ipc_kht_remove(9)ipc_search_maxidx(9)ipc_rmid(9)ipc_set_key_private(9)ipcperms(9)kernel_to_ipc64_perm(9)ipc64_perm_to_ipc_perm(9)ipc_obtain_object_idr(9)ipc_obtain_object_check(9)ipcget(9)ipc_update_perm(9)ipcctl_obtain_check(9)ipc_parse_version(9)sysvipc_find_ipc(9)
and that's the whole page, bestie π«Ά source is ./ipc, dated October 2026, and it's the ipc_addid(9) page β go forth and add your ids responsibly, and remember: writer ipc_ids.rwsem held, always. mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms