diff options
author | Luca Dariz <luca@orpolo.org> | 2023-01-16 11:58:56 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-18 02:27:34 +0100 |
commit | f056fcda8bf9a5c375b20ef3803718187d9d4211 (patch) | |
tree | 0d27ca3eb403ad77ff3587436325f3c62da16a82 /include/mach/port.h | |
parent | 027cf6671fad35d663f25c58430cd8fc6a45e181 (diff) | |
download | gnumach-f056fcda8bf9a5c375b20ef3803718187d9d4211.tar.gz gnumach-f056fcda8bf9a5c375b20ef3803718187d9d4211.tar.bz2 gnumach-f056fcda8bf9a5c375b20ef3803718187d9d4211.zip |
add conversion helpers for invalid mach port names
* include/mach/port.h: add _NAME_ variants for port NULL and DEAD and
add helpers to check for invalid port names
* ipc/port.h: add helpers to properly convert to/from invalid mach
port names.
Message-Id: <20230116105857.240210-7-luca@orpolo.org>
Diffstat (limited to 'include/mach/port.h')
-rw-r--r-- | include/mach/port.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/mach/port.h b/include/mach/port.h index e38be614..c9bbcf17 100644 --- a/include/mach/port.h +++ b/include/mach/port.h @@ -72,9 +72,13 @@ typedef int *rpc_signature_info_t; #define MACH_PORT_NULL 0 /* works with both user and kernel ports */ #define MACH_PORT_DEAD ((mach_port_t) ~0) +#define MACH_PORT_NAME_NULL ((mach_port_name_t) 0) +#define MACH_PORT_NAME_DEAD ((mach_port_name_t) ~0) -#define MACH_PORT_VALID(name) \ - (((name) != MACH_PORT_NULL) && ((name) != MACH_PORT_DEAD)) +#define MACH_PORT_VALID(port) \ + (((port) != MACH_PORT_NULL) && ((port) != MACH_PORT_DEAD)) +#define MACH_PORT_NAME_VALID(name) \ + (((name) != MACH_PORT_NAME_NULL) && ((name) != MACH_PORT_NAME_DEAD)) /* * These are the different rights a task may have. |