diff options
author | Andy Dougherty <doughera@lafayette.edu> | 1998-05-28 09:27:25 -0400 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-05-28 17:59:18 +0000 |
commit | bd89102fe7784367e3eeddc7cefae29defae903a (patch) | |
tree | 79cc385dded6a269bf4f938ac1be5a70c7e644f4 /Configure | |
parent | 1d26b16b4a5b44b9f5893c8b4c8ce90d163883e5 (diff) | |
download | perl-bd89102fe7784367e3eeddc7cefae29defae903a.tar.gz |
[PATCH 5.004_65] Config_65-02-03.diff: SunOS and Solaris hints
Date: Thu, 28 May 1998 13:27:25 -0400 (EDT)
Subject: [PATCH 5.004_65] Config_65-03-04.diff: semctl probing
Date: Thu, 28 May 1998 13:28:21 -0400 (EDT)
p4raw-id: //depot/perl@1047
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 167 |
1 files changed, 166 insertions, 1 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu May 14 12:19:05 EDT 1998 [metaconfig 3.0 PL70] +# Generated on Thu May 28 12:01:39 EDT 1998 [metaconfig 3.0 PL70] cat >/tmp/c1$$ <<EOF ARGGGHHHH!!!!! @@ -481,6 +481,9 @@ d_times='' d_truncate='' d_tzname='' d_umask='' +d_semctl_semid_ds='' +d_semctl_semun='' +d_union_semun='' d_vfork='' usevfork='' d_voidsig='' @@ -7945,6 +7948,165 @@ fi set d_sem eval $setvar +: see whether sys/sem.h defines union semun +echo " " +$cat > try.c <<'END' +#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/sem.h> +int main () { union semun semun; semun.buf = 0; } +END +set try +if eval $compile; then + echo "You have union semun in <sys/sem.h>." >&4 + val="$define" +else + echo "You do not have union semun in <sys/sem.h>." >&4 + val="$undef" +fi +$rm -f try try.c +set d_union_semun +eval $setvar + +: see how to do semctl IPC_STAT +case "$d_sem" in +$define) + : see whether semctl IPC_STAT can use union semun + echo " " + $cat > try.c <<END +#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/stat.h> +#include <stdio.h> +#include <errno.h> +#ifndef errno +extern int errno; +#endif +#$d_union_semun HAS_UNION_SEMUN +int main() { + union semun +#ifndef HAS_UNION_SEMUN + { + int val; + struct semid_ds *buf; + unsigned short *array; + } +#endif + arg; + int sem, st; + +#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) + sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); + if (sem > -1) { + struct semid_ds argbuf; + arg.buf = &argbuf; +# ifdef IPC_STAT + st = semctl(sem, 0, IPC_STAT, arg); + if (st == 0) + printf("semun\n"); + else +# endif /* IPC_STAT */ + printf("semctl IPC_STAT failed: errno = %d\n", errno); +# ifdef IPC_RMID + if (semctl(sem, 0, IPC_RMID, arg) != 0) +# endif /* IPC_RMID */ + printf("semctl IPC_RMID failed: errno = %d\n", errno); + } else +#endif /* IPC_PRIVATE && ... */ + printf("semget failed: errno = %d\n", errno); + return 0; +} +END + val="$undef" + set try + if eval $compile; then + xxx=`./try` + case "$xxx" in + semun) val="$define" ;; + esac + fi + $rm -f try try.c + set d_semctl_semun + eval $setvar + case "$d_semctl_semun" in + $define) + echo "You can use union semun for semctl IPC_STAT." >&4 + also='also' + ;; + *) echo "You cannot use union semun for semctl IPC_STAT." >&4 + also='' + ;; + esac + + : see whether semctl IPC_STAT can use struct semid_ds pointer + $cat > try.c <<'END' +#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/stat.h> +#include <stdio.h> +#include <errno.h> +#ifndef errno +extern int errno; +#endif +int main() { + struct semid_ds arg; + int sem, st; + +#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT) + sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT); + if (sem > -1) { +# ifdef IPC_STAT + st = semctl(sem, 0, IPC_STAT, &arg); + if (st == 0) + printf("semid_ds\n"); + else +# endif /* IPC_STAT */ + printf("semctl IPC_STAT failed: errno = %d\n", errno); +# ifdef IPC_RMID + if (semctl(sem, 0, IPC_RMID, &arg) != 0) +# endif /* IPC_RMID */ + printf("semctl IPC_RMID failed: errno = %d\n", errno); + } else +#endif /* IPC_PRIVATE && ... */ + printf("semget failed: errno = %d\n", errno); + + return 0; +} +END + val="$undef" + set try + if eval $compile; then + xxx=`./try` + case "$xxx" in + semid_ds) val="$define" ;; + esac + fi + $rm -f try try.c + set d_semctl_semid_ds + eval $setvar + case "$d_semctl_semid_ds" in + $define) + echo "You can $also use struct semid_ds * for semctl IPC_STAT." >&4 + ;; + *) echo "You cannot use struct semid_ds * for semctl IPC_STAT." >&4 + ;; + esac + ;; +*) val="$undef" + + # We do not have the full sem*(2) library, so assume we can not + # use either. + + set d_semctl_semun + eval $setvar + + set d_semctl_semid_ds + eval $setvar + ;; +esac + : see if setegid exists set setegid d_setegid eval $inlibc @@ -11132,6 +11294,8 @@ d_seekdir='$d_seekdir' d_select='$d_select' d_sem='$d_sem' d_semctl='$d_semctl' +d_semctl_semid_ds='$d_semctl_semid_ds' +d_semctl_semun='$d_semctl_semun' d_semget='$d_semget' d_semop='$d_semop' d_setegid='$d_setegid' @@ -11196,6 +11360,7 @@ d_truncate='$d_truncate' d_tzname='$d_tzname' d_umask='$d_umask' d_uname='$d_uname' +d_union_semun='$d_union_semun' d_vfork='$d_vfork' d_void_closedir='$d_void_closedir' d_voidsig='$d_voidsig' |