From 495d3cf2bdf5e1ce0654f37a3d983d55e098964d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 19 Feb 2021 12:14:36 +0100 Subject: prepare for lab 3 --- src/lib/pid_t.h | 15 +++++++++++++++ src/lib/user/syscall.h | 4 +--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/lib/pid_t.h (limited to 'src/lib') diff --git a/src/lib/pid_t.h b/src/lib/pid_t.h new file mode 100644 index 0000000..c6d8e31 --- /dev/null +++ b/src/lib/pid_t.h @@ -0,0 +1,15 @@ +#ifndef LIB_PID_T_H +#define LIB_PID_T_H + +/* Process identifier. + Moved from lib/user/syscall.h since both kernel- + and user-space want the same definition. */ +typedef int pid_t; + +#define PID_ERROR ((pid_t) -1) + +/* Format specifier for printf(), e.g.: + printf ("pid=%"PRPTd"\n", pid); */ +#define PRPTd d + +#endif /* lib/pid_t.h */ diff --git a/src/lib/user/syscall.h b/src/lib/user/syscall.h index 8a9e0c0..a152dd1 100644 --- a/src/lib/user/syscall.h +++ b/src/lib/user/syscall.h @@ -4,9 +4,7 @@ #include #include -/* Process identifier. */ -typedef int pid_t; -#define PID_ERROR ((pid_t) -1) +#include "lib/pid_t.h" /* Map region identifier. */ typedef int mapid_t; -- cgit v1.2.1