diff options
Diffstat (limited to 'contrib/bmake/unit-tests/varname-dot-make-pid.mk')
-rw-r--r-- | contrib/bmake/unit-tests/varname-dot-make-pid.mk | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/bmake/unit-tests/varname-dot-make-pid.mk b/contrib/bmake/unit-tests/varname-dot-make-pid.mk index bea114d33547..d7ef5bfd5c44 100644 --- a/contrib/bmake/unit-tests/varname-dot-make-pid.mk +++ b/contrib/bmake/unit-tests/varname-dot-make-pid.mk @@ -1,8 +1,16 @@ -# $NetBSD: varname-dot-make-pid.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# $NetBSD: varname-dot-make-pid.mk,v 1.3 2022/01/23 21:48:59 rillig Exp $ # -# Tests for the special .MAKE.PID variable. +# Tests for the special .MAKE.PID variable, which contains the process ID of +# the make process itself. -# TODO: Implementation +# The process ID must be a positive integer. +.if ${.MAKE.PID:C,[0-9],,g} != "" +. error +.elif !(${.MAKE.PID} > 0) +. error +.endif -all: - @:; +# Ensure that the process exists. +_!= kill -0 ${.MAKE.PID} + +all: .PHONY |