Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/dyninst/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/dyninst/ctime.stp
/* ctime.stp - Convert seconds to human readable date string.
 *
 * Copyright (C) 2012-2016 Red Hat, Inc.
 */

/* NB: functionally equivalent to linux/ctime.stp
 * This means unlike normal userspace ctime(), this version
 * returns time in UTC, without a final newline.
 */

%{
#include <string.h>
#include <time.h>
%}

function ctime:string(epochsecs:long)
%{  /* pure */
    struct tm gmt;
    char buf[26];

    const time_t t = STAP_ARG_epochsecs;

    if (gmtime_r(&t, &gmt) && asctime_r(&gmt, buf)) {
        char* newline = strchr(buf, '\n');
        if (newline)
            *newline = '\0';
        strlcpy (STAP_RETVALUE, buf, MAXSTRINGLEN);
    } else {
#if STAP_COMPAT_VERSION <= STAP_VERSION(2,2)
        strlcpy(STAP_RETVALUE, "<invalid time>", MAXSTRINGLEN);
#else
	CONTEXT->last_error = "Time cannot be converted";
#endif
    }
%}

function ctime:string()
{
  return ctime(gettimeofday_s())
}

Spamworldpro Mini