This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
prctl needs unistd on Android
[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
fec0d67d
MBT
41#ifdef __ANDROID__
42#include <unistd.h>
43#endif
20608326
MB
44#include <sys/prctl.h>
45
46int main (int argc, char *argv[])
47{
48 return (prctl (PR_SET_NAME, "Test"));
49 } /* main */
50EOM
51 set try
52 if eval $compile_ok && $run ./try; then
53 echo "Your prctl (PR_SET_NAME, ...) works"
54 d_prctl_set_name=$define
55 fi
56 $rm_try
57 ;;
58 esac
59