1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:48:14 +00:00

Kernel: Strongly typed user & group ID's

Prior to this change, both uid_t and gid_t were typedef'ed to `u32`.
This made it easy to use them interchangeably. Let's not allow that.

This patch adds UserID and GroupID using the AK::DistinctNumeric
mechanism we've already been employing for pid_t/ProcessID.
This commit is contained in:
Andreas Kling 2021-08-28 22:11:16 +02:00
parent 59335bd8ea
commit ae197deb6b
44 changed files with 172 additions and 169 deletions

View file

@ -16,7 +16,7 @@ namespace Kernel {
static Atomic<int> s_next_fifo_id = 1;
RefPtr<FIFO> FIFO::try_create(uid_t uid)
RefPtr<FIFO> FIFO::try_create(UserID uid)
{
auto buffer = DoubleBuffer::try_create();
if (buffer)
@ -65,7 +65,7 @@ KResultOr<NonnullRefPtr<FileDescription>> FIFO::open_direction_blocking(FIFO::Di
return description;
}
FIFO::FIFO(uid_t uid, NonnullOwnPtr<DoubleBuffer> buffer)
FIFO::FIFO(UserID uid, NonnullOwnPtr<DoubleBuffer> buffer)
: m_buffer(move(buffer))
, m_uid(uid)
{