From 5ff680264f64714c57853e5a083ac321240681e3 Mon Sep 17 00:00:00 2001 From: dsl Date: Sun, 17 Jun 2007 10:21:25 +0000 Subject: [PATCH] Add a define to reduce the source size of the various callers of semctl1() --- sys/sys/sem.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/sys/sem.h b/sys/sys/sem.h index 6029530bd2d8..63d62d0d0699 100644 --- a/sys/sys/sem.h +++ b/sys/sys/sem.h @@ -1,4 +1,4 @@ -/* $NetBSD: sem.h,v 1.22 2006/07/23 22:06:14 ad Exp $ */ +/* $NetBSD: sem.h,v 1.23 2007/06/17 10:21:25 dsl Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -228,6 +228,10 @@ void seminit(void); void semexit(struct proc *, void *); int semctl1(struct lwp *, int, int, int, void *, register_t *); +#define get_semctl_arg(cmd, sembuf, arg) \ + ((cmd) == IPC_SET || (cmd) == IPC_STAT ? (void *)sembuf \ + : (cmd) == GETALL || (cmd) == SETVAL || (cmd) == SETALL ? (void *)arg \ + : NULL) #endif /* !_KERNEL */ #endif /* !_SYS_SEM_H_ */