From faf3710ec1024810d0255f6356cd0a9d12d2cf9b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 16 Jan 2023 15:41:58 +0200 Subject: make process ids signed + Unlikely to ever run into billions of threads, and this keeps in line with stuff like Linux. Also allows C to relatively painlessly implement hashmaps of pids, if neccessary. --- include/apos/types.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/apos/types.h') diff --git a/include/apos/types.h b/include/apos/types.h index e06ccd0..431d551 100644 --- a/include/apos/types.h +++ b/include/apos/types.h @@ -441,8 +441,11 @@ typedef int32_t ssize_t; /** Status, used with codes in \ref status_codes. */ typedef int_fast8_t stat_t; -/** ID of something. */ -typedef uint_fast32_t id_t; +/** ID of something. @todo should this be signed? Linux etc seems to assume it + * is with pids */ +typedef int_fast32_t id_t; + +#define ID_MAX INT_FAST32_MAX /** Memory region flags. */ typedef uint_fast16_t vmflags_t; -- cgit v1.3