MOON
Server: Apache
System: Linux cl1170g 4.19.62-mod-std-ipv6-64-rescue #828825 SMP Tue Jul 30 13:54:49 UTC 2019 x86_64
User: wh0f20bb (1057)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //usr/share/systemtap/tapset/random.stp
/**
 * sfunction randint - Return a random number between [0,n)
 * @n: Number past upper limit of range, not larger than 2**20.
 */
function randint:long(n:long) 
%{	/* unprivileged */
#define RANDMAX (1024*1024)
        if ((unsigned long)STAP_ARG_n > RANDMAX)
           CONTEXT->last_error = "range too wide";
        else {
  	   STAP_RETVALUE = (uint64_t) _stp_random_u((unsigned long) STAP_ARG_n);
        }
#undef RANDMAX
%}