return pp_ftrowned();
}
+PP(pp_ftsuid)
+{
+ return pp_ftrowned();
+}
+
+PP(pp_ftsgid)
+{
+ return pp_ftrowned();
+}
+
+PP(pp_ftsvtx)
+{
+ return pp_ftrowned();
+}
+
U8 *
Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
{
MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftdir */
MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftpipe */
MEMBER_TO_FPTR(Perl_pp_ftlink),
- MEMBER_TO_FPTR(Perl_pp_ftsuid),
- MEMBER_TO_FPTR(Perl_pp_ftsgid),
- MEMBER_TO_FPTR(Perl_pp_ftsvtx),
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsuid */
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsgid */
+ MEMBER_TO_FPTR(Perl_pp_ftrowned), /* Perl_pp_ftsvtx */
MEMBER_TO_FPTR(Perl_pp_fttty),
MEMBER_TO_FPTR(Perl_pp_fttext),
MEMBER_TO_FPTR(Perl_pp_fttext), /* Perl_pp_ftbinary */
Perl_pp_getpeername => ['getsockname'],
Perl_pp_stat => ['lstat'],
Perl_pp_ftrowned => [qw(fteowned ftzero ftsock ftchr ftblk
- ftfile ftdir ftpipe)],
+ ftfile ftdir ftpipe ftsuid ftsgid
+ ftsvtx)],
Perl_pp_fttext => ['ftbinary'],
Perl_pp_gmtime => ['localtime'],
Perl_pp_semget => [qw(shmget msgget)],
{
I32 result;
dSP;
+
+ /* I believe that all these three are likely to be defined on most every
+ system these days. */
+#ifndef S_ISUID
+ if(PL_op->op_type == OP_FTSUID)
+ RETPUSHNO;
+#endif
+#ifndef S_ISGID
+ if(PL_op->op_type == OP_FTSGID)
+ RETPUSHNO;
+#endif
+#ifndef S_ISVTX
+ if(PL_op->op_type == OP_FTSVTX)
+ RETPUSHNO;
+#endif
+
STACKED_FTEST_CHECK;
result = my_stat();
SPAGAIN;
if (S_ISFIFO(PL_statcache.st_mode))
RETPUSHYES;
break;
- }
- RETPUSHNO;
-}
-
-PP(pp_ftlink)
-{
- I32 result = my_lstat();
- dSP;
- if (result < 0)
- RETPUSHUNDEF;
- if (S_ISLNK(PL_statcache.st_mode))
- RETPUSHYES;
- RETPUSHNO;
-}
-
-PP(pp_ftsuid)
-{
- dSP;
#ifdef S_ISUID
- I32 result;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (PL_statcache.st_mode & S_ISUID)
- RETPUSHYES;
+ case OP_FTSUID:
+ if (PL_statcache.st_mode & S_ISUID)
+ RETPUSHYES;
+ break;
#endif
- RETPUSHNO;
-}
-
-PP(pp_ftsgid)
-{
- dSP;
#ifdef S_ISGID
- I32 result;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
- if (result < 0)
- RETPUSHUNDEF;
- if (PL_statcache.st_mode & S_ISGID)
- RETPUSHYES;
+ case OP_FTSGID:
+ if (PL_statcache.st_mode & S_ISGID)
+ RETPUSHYES;
+ break;
+#endif
+#ifdef S_ISVTX
+ case OP_FTSVTX:
+ if (PL_statcache.st_mode & S_ISVTX)
+ RETPUSHYES;
+ break;
#endif
+ }
RETPUSHNO;
}
-PP(pp_ftsvtx)
+PP(pp_ftlink)
{
+ I32 result = my_lstat();
dSP;
-#ifdef S_ISVTX
- I32 result;
- STACKED_FTEST_CHECK;
- result = my_stat();
- SPAGAIN;
if (result < 0)
RETPUSHUNDEF;
- if (PL_statcache.st_mode & S_ISVTX)
+ if (S_ISLNK(PL_statcache.st_mode))
RETPUSHYES;
-#endif
RETPUSHNO;
}