This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport of bd2aeadfa5cb8ea8dbfc9c3060728594d8452bc6
[metaconfig.git] / U / perl / d_prctl.U
CommitLineData
20608326
MB
1?RCS: $Id$
2?RCS:
3?RCS: Copyright (c) 2010 H.Merijn Brand
4?RCS:
5?RCS: You may distribute under the terms of either the GNU General Public
6?RCS: License or the Artistic License, as specified in the README file.
7?RCS:
8?MAKE:d_prctl d_prctl_set_name: Inlibc cat Compile run rm_try
9?MAKE: -pick add $@ %<
10?S:d_prctl:
11?S: This variable conditionally defines the HAS_PRCTL symbol, which
12?S: indicates to the C program that the prctl() routine is available.
13?S:.
14?S:d_prctl_set_name:
3c9e787c
MB
15?S: This variable conditionally defines the HAS_PRCTL_SET_NAME symbol,
16?S: which indicates to the C program that the prctl() routine supports
17?S: the PR_SET_NAME option.
20608326
MB
18?S:.
19?C:HAS_PRCTL:
20?C: This symbol, if defined, indicates that the prctl routine is
21?C: available to set process title.
22?C:.
23?C:HAS_PRCTL_SET_NAME:
24?C: This symbol, if defined, indicates that the prctl routine is
25?C: available to set process title and supports PR_SET_NAME.
26?C:.
27?H:#$d_prctl HAS_PRCTL /**/
28?H:#$d_prctl_set_name HAS_PRCTL_SET_NAME /**/
29?H:.
30?F:!try
31?LINT:set d_prctl
32: see if prctl exists
33set prctl d_prctl
34eval $inlibc
35
36: see if prctl supports PR_SET_NAME
37d_prctl_set_name=$undef
38case $d_prctl in
39 $define)
40 $cat >try.c <<EOM
41#include <sys/prctl.h>
42
43int main (int argc, char *argv[])
44{
45 return (prctl (PR_SET_NAME, "Test"));
46 } /* main */
47EOM
48 set try
49 if eval $compile_ok && $run ./try; then
50 echo "Your prctl (PR_SET_NAME, ...) works"
51 d_prctl_set_name=$define
52 fi
53 $rm_try
54 ;;
55 esac
56