1 ?RCS: $Id: d_shmat.U,v 3.0.1.3 1995/07/25 14:04:23 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: d_shmat.U,v $
12 ?RCS: Revision 3.0.1.3 1995/07/25 14:04:23 ram
13 ?RCS: patch56: use findhdr to find <sys/shm.h>, to get the right one (ADO)
15 ?RCS: Revision 3.0.1.2 1994/05/13 15:18:56 ram
16 ?RCS: patch27: added new symbol HAS_SHMAT_PROTOTYPE (ADO)
18 ?RCS: Revision 3.0.1.1 1994/05/06 14:54:18 ram
19 ?RCS: patch23: new Shmat_t symbol to declare return type of shmat()
21 ?RCS: Revision 3.0 1993/08/18 12:07:18 ram
22 ?RCS: Baseline for dist 3.0 netwide release.
24 ?MAKE:d_shmat shmattype d_shmatprototype: Inlibc cat +cc +ccflags \
25 rm cppstdin cppflags cppminus Findhdr Setvar contains
26 ?MAKE: -pick add $@ %<
28 ?S: This variable conditionally defines the HAS_SHMAT symbol, which
29 ?S: indicates to the C program that the shmat() routine is available.
32 ?S: This symbol contains the type of pointer returned by shmat().
33 ?S: It can be 'void *' or 'char *'.
36 ?S: This variable conditionally defines the HAS_SHMAT_PROTOTYPE
37 ?S: symbol, which indicates that sys/shm.h has a prototype for
41 ?C: This symbol, if defined, indicates that the shmat() routine is
42 ?C: available to attach a shared memory segment to the process space.
45 ?C: This symbol holds the return type of the shmat() system call.
46 ?C: Usually set to 'void *' or 'char *'.
48 ?C:HAS_SHMAT_PROTOTYPE:
49 ?C: This symbol, if defined, indicates that the sys/shm.h includes
50 ?C: a prototype for shmat(). Otherwise, it is up to the program to
51 ?C: guess one. Shmat_t shmat _((int, Shmat_t, int)) is a good guess,
52 ?C: but not always right so it should be emitted by the program only
53 ?C: when HAS_SHMAT_PROTOTYPE is not defined to avoid conflicting defs.
55 ?H:#$d_shmat HAS_SHMAT /**/
56 ?H:#define Shmat_t $shmattype /**/
57 ?H:#$d_shmatprototype HAS_SHMAT_PROTOTYPE /**/
59 ?LINT:set d_shmat d_shmatprototype
64 : see what shmat returns
71 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
76 echo "and it returns ($shmattype)." >&4
77 : see if a prototype for shmat is available
78 xxx=`./findhdr sys/shm.h`
79 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
80 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then