summaryrefslogtreecommitdiff
path: root/U/groupstype.U
blob: 355ea14980e10a02bf897528858e248cd4234bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
?RCS: $Id: groupstype.U,v$
?RCS:
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
?RCS: of the source tree for dist 3.0.
?RCS:
?RCS: $Log: groupstype.U,v $
?RCS:
?MAKE:groupstype: gidtype d_getgrps Myread Oldconfig Findhdr cat Setvar
?MAKE:	-pick add $@ %<
?INIT:groupstype=''
?S:groupstype:
?S:	This variable defines GROUPSTYPE to be something like gid_t, int, 
?S:	ushort, or whatever type is used for the second argument to
?S:	getgroups().  Usually, this is the same of gidtype, but
?S:	sometimes it isn't.
?S:.
?C:GROUPSTYPE:
?C:	This symbol holds the type used for the second argument to
?C:	getgroups().  Usually, this is the same of gidtype, but
?C:	sometimes it isn't.  It can be int, ushort, uid_t, etc... 
?C:	It may be necessary to include <sys/types.h> to get any 
?C:	typedef'ed information.  This is only required if you have
?C:	getgroups().
?C:.
?H:?%<:#ifdef HAS_GETGROUPS
?H:?%<:#define GROUPSTYPE $groupstype	/* Type for 2nd arg to getgroups() */
?H:?%<:#endif
?H:.
?W:%<:getgroups HAS_GETGROUPS
case "$d_getgrps" in
'define')
    case "$groupstype" in
	'') dflt="$gidtype" ;;
	*)  dflt="$groupstype" ;;
    esac
    echo " "
    $cat <<EOM
What is the type of the second argument to getgroups()?  Usually this
is the same as group ids, $gidtype, but not always.
EOM
    rp="What type is the second arguement to getgroups()?"
    . ./myread
    val="$ans"
    ;;
*)  val="$gidtype";;
esac
set groupstype
eval $setvar