Compress-Stream-Zstd

 view release on metacpan or  search on metacpan

ext/zstd/programs/fileio.c  view on Meta::CPAN

/*-*************************************
*  Constants
***************************************/
#define ADAPT_WINDOWLOG_DEFAULT 23   /* 8 MB */
#define DICTSIZE_MAX (32 MB)   /* protection against large input (attack scenario) */

#define FNSPACE 30

/* Default file permissions 0666 (modulated by umask) */
/* Temporary restricted file permissions are used when we're going to
 * chmod/chown at the end of the operation. */
#if !defined(_WIN32)
/* These macros aren't defined on windows. */
#define DEFAULT_FILE_PERMISSIONS (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#define TEMPORARY_FILE_PERMISSIONS (S_IRUSR|S_IWUSR)
#else
#define DEFAULT_FILE_PERMISSIONS (0666)
#define TEMPORARY_FILE_PERMISSIONS (0600)
#endif

/*-************************************

ext/zstd/programs/util.c  view on Meta::CPAN

#include <stdlib.h>     /* malloc, realloc, free */
#include <stdio.h>      /* fprintf */
#include <time.h>       /* clock_t, clock, CLOCKS_PER_SEC, nanosleep */
#include <errno.h>
#include <assert.h>

#if defined(_WIN32)
#  include <sys/utime.h>  /* utime */
#  include <io.h>         /* _chmod */
#else
#  include <unistd.h>     /* chown, stat */
#  if PLATFORM_POSIX_VERSION < 200809L || !defined(st_mtime)
#    include <utime.h>    /* utime */
#  else
#    include <fcntl.h>    /* AT_FDCWD */
#    include <sys/stat.h> /* utimensat */
#  endif
#endif

#if defined(_MSC_VER) || defined(__MINGW32__) || defined (__MSVCRT__)
#include <direct.h>     /* needed for _mkdir in windows */

ext/zstd/programs/util.c  view on Meta::CPAN

     *
     * "Change the group first, then the permissions, then the owner.
     * That way, the permissions will be correct on systems that allow
     * users to give away files, without introducing a security hole.
     * Security depends on permissions not containing the setuid or
     * setgid bits." */

#if !defined(_WIN32)
#ifdef ZSTD_HAVE_FCHOWN
    if (fd >= 0) {
        res += fchown(fd, -1, statbuf->st_gid);  /* Apply group ownership */
    } else
#endif
    {
        res += chown(filename, -1, statbuf->st_gid);  /* Apply group ownership */
    }
#endif

    res += UTIL_fchmod(fd, filename, &curStatBuf, statbuf->st_mode & 0777);  /* Copy file permissions */

#if !defined(_WIN32)
#ifdef ZSTD_HAVE_FCHOWN
    if (fd >= 0) {
        res += fchown(fd, statbuf->st_uid, -1);  /* Apply user ownership */
    } else
#endif
    {
        res += chown(filename, statbuf->st_uid, -1);  /* Apply user ownership */
    }
#endif

    errno = 0;
    UTIL_TRACE_RET(-res);
    return -res; /* number of errors is returned */
}

int UTIL_isDirectory(const char* infilename)
{

ext/zstd/tests/gzip/help-version.sh  view on Meta::CPAN


comm_setup () { args="$tmp_in $tmp_in"; }
csplit_setup () { args="$tmp_in //"; }
cut_setup () { args='-f 1'; }
join_setup () { args="$tmp_in $tmp_in"; }
tr_setup () { args='a a'; }

chmod_setup () { args="a+x $tmp_in"; }
# Punt on these.
chgrp_setup () { args=--version; }
chown_setup () { args=--version; }
mkfifo_setup () { args=--version; }
mknod_setup () { args=--version; }
# Punt on uptime, since it fails (e.g., failing to get boot time)
# on some systems, and we shouldn't let that stop `make check'.
uptime_setup () { args=--version; }

# Create a file in the current directory, not in $TMPDIR.
mktemp_setup () { args=mktemp.XXXX; }

cmp_setup () { args="$tmp_in $tmp_in2"; }

ppport.h  view on Meta::CPAN

KEY_binmode|5.003007||Viu
KEY_bless|5.003007||Viu
KEY_break|5.027008||Viu
KEY_caller|5.003007||Viu
KEY_catch|5.033007||Viu
KEY_chdir|5.003007||Viu
KEY_CHECK|5.006000||Viu
KEY_chmod|5.003007||Viu
KEY_chomp|5.003007||Viu
KEY_chop|5.003007||Viu
KEY_chown|5.003007||Viu
KEY_chr|5.003007||Viu
KEY_chroot|5.003007||Viu
KEY_close|5.003007||Viu
KEY_closedir|5.003007||Viu
KEY_cmp|5.003007||Viu
KEY_connect|5.003007||Viu
KEY_continue|5.003007||Viu
KEY_cos|5.003007||Viu
KEY_crypt|5.003007||Viu
KEY___DATA|5.003007||Viu

ppport.h  view on Meta::CPAN

Perl_isnan|5.006001|5.006001|n
PERL_IS_SUBWORD_ADDR|5.027007||Viu
PERL_IS_UTF8_CHAR_DFA|5.035004||Viu
PERL_JNP_TO_DECIMAL|5.033001||Viu
Perl_langinfo|5.027004|5.027004|n
PERL_LANGINFO_H|5.027004||Viu
PERL_LAST_5_18_0_INTERP_MEMBER|5.017009||Viu
Perl_ldexp|5.021003|5.021003|n
PerlLIO_access|5.005000||Viu
PerlLIO_chmod|5.005000||Viu
PerlLIO_chown|5.005000||Viu
PerlLIO_chsize|5.005000||Viu
PerlLIO_close|5.005000||Viu
PerlLIO_dup2|5.005000||Viu
PerlLIO_dup2_cloexec|5.027008||Viu
PerlLIO_dup|5.005000||Viu
PerlLIO_dup_cloexec|5.027008||Viu
PerlLIO_flock|5.005000||Viu
PerlLIO_fstat|5.005000||Viu
PerlLIO_ioctl|5.005000||Viu
PerlLIO_isatty|5.005000||Viu



( run in 0.692 second using v1.01-cache-2.11-cpan-71847e10f99 )