This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
infnan: move the mantbits definitions from perl.h to Configure
[metaconfig.git] / U / perl / d_prctl.U
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:     Note that there are at least two prctl variants: Linux and Irix.
14 ?S:     While they are somewhat similar, they are incompatible.
15 ?S:.
16 ?S:d_prctl_set_name:
17 ?S:     This variable conditionally defines the HAS_PRCTL_SET_NAME symbol,
18 ?S:     which indicates to the C program that the prctl() routine supports
19 ?S:     the PR_SET_NAME option.
20 ?S:.
21 ?C:HAS_PRCTL:
22 ?C:     This symbol, if defined, indicates that the prctl routine is
23 ?C:     available to set process title.
24 ?C:     Note that there are at least two prctl variants: Linux and Irix.
25 ?C:     While they are somewhat similar, they are incompatible.
26 ?C:.
27 ?C:HAS_PRCTL_SET_NAME:
28 ?C:     This symbol, if defined, indicates that the prctl routine is
29 ?C:     available to set process title and supports PR_SET_NAME.
30 ?C:.
31 ?H:#$d_prctl HAS_PRCTL          /**/
32 ?H:#$d_prctl_set_name HAS_PRCTL_SET_NAME                /**/
33 ?H:.
34 ?F:!try
35 ?LINT:set d_prctl
36 : see if prctl exists
37 set prctl d_prctl
38 eval $inlibc
39
40 : see if prctl supports PR_SET_NAME
41 d_prctl_set_name=$undef
42 case $d_prctl in
43     $define)
44         $cat >try.c <<EOM
45 #ifdef __ANDROID__
46 #include <unistd.h>
47 #endif
48 #include <sys/prctl.h>
49
50 int main (int argc, char *argv[])
51 {
52     return (prctl (PR_SET_NAME, "Test"));
53     } /* main */
54 EOM
55         set try
56         if eval $compile_ok && $run ./try; then
57             echo "Your prctl (PR_SET_NAME, ...) works"
58             d_prctl_set_name=$define
59             fi
60         $rm_try
61         ;;
62     esac
63