From: Jarkko Hietaniemi Date: Sat, 18 Mar 2000 21:40:55 +0000 (+0000) Subject: (Re-)introduce $uidsign and $gidsign. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23dcd6c8b343c4ac87d3915a222eed14cf6c153a;p=p5sagit%2Fp5-mst-13.2.git (Re-)introduce $uidsign and $gidsign. p4raw-id: //depot/cfgperl@5808 --- diff --git a/Configure b/Configure index f722d38..33d0566 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sat Mar 18 19:51:46 EET 2000 [metaconfig 3.0 PL70] +# Generated on Sat Mar 18 23:12:11 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ < to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have * getgroups() or setgropus().. @@ -2864,6 +2870,12 @@ */ #define Uid_t_f "u" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign 1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/config_h.SH b/config_h.SH index 6cb591e..52f4cb8 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2218,6 +2218,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Gid_t_f $gidformat /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign $gidsign /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2227,16 +2233,16 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t $gidtype /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have * getgroups() or setgropus().. @@ -2878,6 +2884,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Uid_t_f $uidformat /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign $uidsign /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/epoc/config.sh b/epoc/config.sh index 8b9f982..a60b7a0 100644 --- a/epoc/config.sh +++ b/epoc/config.sh @@ -770,7 +770,9 @@ i_sysstatfs='undef' i_sysvfs='undef' i_ustat='undef' uidsize='2' +uidsign='1' gidsize='2' +gidsign='1' ivdformat='"ld"' uvuformat='"lu"' uvoformat='"lo"' diff --git a/pp_sys.c b/pp_sys.c index 517a955..5bbe250 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2546,12 +2546,20 @@ PP(pp_stat) #if Uid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid))); #else +# if Uid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_uid))); +# endif #endif #if Gid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_gid))); #else +# if Gid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_gid))); +# endif #endif #ifdef USE_STAT_RDEV PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev))); @@ -4801,7 +4809,11 @@ PP(pp_gpwent) PUSHs(sv = sv_newmortal()); if (pwent) { if (which == OP_GPWNAM) +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif else sv_setpv(sv, pwent->pw_name); } @@ -4825,11 +4837,18 @@ PP(pp_gpwent) #endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_gid); - +#else + sv_setuv(sv, (UV)pwent->pw_gid); +#endif /* pw_change, pw_quota, and pw_age are mutually exclusive. */ PUSHs(sv = sv_mortalcopy(&PL_sv_no)); #ifdef PWCHANGE diff --git a/vms/subconfigure.com b/vms/subconfigure.com index 8650b0f..56de278 100644 --- a/vms/subconfigure.com +++ b/vms/subconfigure.com @@ -74,10 +74,12 @@ $ perl_shmattype = "" $ perl_mmaptype = "" $ perl_gidformat = "lu" $ perl_gidsize = "4" +$ perl_gidsign = "1" $ perl_groupstype = "Gid_t" $ perl_stdio_stream_array = "" $ perl_uidformat = "lu" $ perl_uidsize = "4" +$ perl_uidsign = "1" $ perl_d_getcwd = "undef" $ perl_d_nv_preserves_uv = "define" $ perl_d_fs_data_s = "undef" @@ -4013,9 +4015,11 @@ $ WC "pager='" + perl_pager + "'" $ WC "uidtype='" + perl_uidtype + "'" $ WC "uidformat='" + perl_uidformat + "'" $ WC "uidsize='" + perl_uidsize + "'" +$ WC "uidsign='" + perl_uidsign + "'" $ WC "gidtype='" + perl_gidtype + "'" $ WC "gidformat='" + perl_gidformat + "'" $ WC "gidsize='" + perl_gidsize + "'" +$ WC "gidsign='" + perl_gidsign + "'" $ WC "usethreads='" + perl_usethreads + "'" $ WC "d_pthread_yield='" + perl_d_pthread_yield + "'" $ WC "d_pthreads_created_joinable='" + perl_d_pthreads_created_joinable + "'" diff --git a/vos/config.def b/vos/config.def index 10d44a2..1352c05 100644 --- a/vos/config.def +++ b/vos/config.def @@ -286,6 +286,7 @@ $full_csh='' $full_sed='/system/ported/command_library/sed.pm' $gidformat='"d"' $gidsize='4' +$gidsign='-1' $gidtype='gid_t' $groupstype='gid_t' $i16size='2' @@ -439,6 +440,7 @@ $u8size='1' $u8type='unsigned char' $uidformat='"d"' $uidsize='4' +$uidsign='-1' $uidtype='uid_t' $uquadtype='_error_' $use5005threads='undef' diff --git a/vos/config.h b/vos/config.h index d325815..d77218a 100644 --- a/vos/config.h +++ b/vos/config.h @@ -2199,6 +2199,12 @@ */ #define Gid_t_f "d" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2208,19 +2214,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2847,6 +2853,12 @@ */ #define Uid_t_f "d" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/vos/config_h.SH_orig b/vos/config_h.SH_orig index c0c5b8f..b743847 100755 --- a/vos/config_h.SH_orig +++ b/vos/config_h.SH_orig @@ -2217,6 +2217,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Gid_t_f $gidformat /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign $gidsign /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2226,19 +2232,19 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t $gidtype /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t $groupstype /* Type for 2nd arg to [sg]etgroups() */ @@ -2865,6 +2871,12 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #define Uid_t_f $uidformat /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign $uidsign /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.bc b/win32/config_H.bc index bae4f8b..7e48f29 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "d" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "d" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.gc b/win32/config_H.gc index e1d5052..e12856c 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "ld" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "ld" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */ diff --git a/win32/config_H.vc b/win32/config_H.vc index beb643b..8f4b183 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -2206,6 +2206,12 @@ */ #define Gid_t_f "ld" /**/ +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + /* Gid_t_size: * This symbol holds the size of a Gid_t in bytes. */ @@ -2215,19 +2221,19 @@ * This symbol holds the return type of getgid() and the type of * argument to setrgid() and related functions. Typically, * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include to get + * gid_t, etc... It may be necessary to include to get * any typedef'ed information. */ #define Gid_t gid_t /* Type for getgid(), etc... */ /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ @@ -2817,7 +2823,7 @@ /* Size_t_size: * This symbol holds the size of a Size_t in bytes. */ -#define Size_t_size $sizesize /* */ +#define Size_t_size 4 /* */ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2866,6 +2872,12 @@ */ #define Uid_t_f "ld" /**/ +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. + */ +#define Uid_t_sign -1 /* UID sign */ + /* Uid_t_size: * This symbol holds the size of a Uid_t in bytes. */