This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 8
[perl5.git] / U / gidtype.U
1 ?X:  These units are based on the ones supplied with dist-3.0
2 ?X:  patchlevel 22.  They have been changed or enhanced to work with
3 ?X:  perl5alpha.  I would appreciate hearing about any changes,
4 ?X:  corrections, or enhancements.
5 ?X:     Andy Dougherty                  doughera@lafcol.lafayette.edu
6 ?X:     Dept. of Physics                
7 ?X:     Lafayette College       
8 ?X:     Easton, PA  18042-1782
9 ?X:     Sat Apr  2 15:45:17 EST 1994
10 ?RCS: $Id: gidtype.U,v 3.0 1993/08/18 12:08:11 ram Exp $
11 ?RCS:
12 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
13 ?RCS: 
14 ?RCS: You may redistribute only under the terms of the Artistic Licence,
15 ?RCS: as specified in the README file that comes with the distribution.
16 ?RCS: You may reuse parts of this distribution only within the terms of
17 ?RCS: that same Artistic Licence; a copy of which may be found at the root
18 ?RCS: of the source tree for dist 3.0.
19 ?RCS:
20 ?RCS: $Log: gidtype.U,v $
21 ?RCS: Revision 3.0  1993/08/18  12:08:11  ram
22 ?RCS: Baseline for dist 3.0 netwide release.
23 ?RCS:
24 ?MAKE:gidtype: Myread Oldconfig contains Findhdr
25 ?MAKE:  -pick add $@ %<
26 ?S:gidtype:
27 ?S:     This variable defines Gid_t to be something like gid_t, int, 
28 ?S:     ushort, or whatever type is used to declare the return type
29 ?S:     of getgid().  Typically, it is the type of group ids in the kernel.
30 ?S:.
31 ?C:Gid_t (GIDTYPE):
32 ?C:     This symbol holds the return type of getgid() and the type of
33 ?C:     argument to setrgid() and related functions.  Typically,
34 ?C:     it is the type of group ids in the kernel.
35 ?C:     It can be int, ushort, uid_t, etc... It may be necessary to include
36 ?C:     <sys/types.h> to get any typedef'ed information.
37 ?C:.
38 ?H:#define Gid_t $gidtype               /* Type for getgid(), etc... */
39 ?H:.
40 ?T:xxx
41 : see what type gids are declared as in the kernel
42 case "$gidtype" in
43 '')
44         if $contains 'gid_t;' `./findhdr sys/types.h` >/dev/null 2>&1 ; then
45                 dflt='gid_t';
46         else
47                 xxx=`./findhdr sys/user.h`
48                 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
49                 case $1 in
50                 unsigned) dflt="$1 $2" ;;
51                 *) dflt="$1" ;;
52                 esac
53         fi
54         ;;
55 *)  dflt="$gidtype";;
56 esac
57 echo " "
58 rp="What is the type for group ids returned by getgid()?"
59 . ./myread
60 gidtype="$ans"