xref: /freebsd/contrib/bmake/unit-tests/varname-dot-make-pid.mk (revision 9f45a3c8c82ffead7044ae836d9257113c630d3b)
1# $NetBSD: varname-dot-make-pid.mk,v 1.3 2022/01/23 21:48:59 rillig Exp $
2#
3# Tests for the special .MAKE.PID variable, which contains the process ID of
4# the make process itself.
5
6# The process ID must be a positive integer.
7.if ${.MAKE.PID:C,[0-9],,g} != ""
8.  error
9.elif !(${.MAKE.PID} > 0)
10.  error
11.endif
12
13# Ensure that the process exists.
14_!=	kill -0 ${.MAKE.PID}
15
16all: .PHONY
17