403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/emulators/rtc/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/emulators/rtc/files/test.c
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioccom.h>

#include <rtc.h>


int main(void)
{
	int rtc;
	fd_set rset;
	int i,rc;
	int ntests=100;
	struct timeval tv;
	struct timeval begin,end,delta;


	rtc = open("/dev/rtc", O_RDONLY);	
	if (rtc<0) {
		perror("/dev/rtc");
		return 1;
	}

	rc = ioctl(rtc, RTCIO_IRQP_SET, 512);
	if (rc<0) {
		perror("/dev/rtc");
		return 1;
	}

	rc = ioctl(rtc, RTCIO_PIE_ON, NULL);
	if (rc<0) {
		perror("/dev/rtc");
		return 1;
	}
	
	gettimeofday(&begin, NULL);	
	for (i=0; i<ntests; i++) {
		FD_ZERO(&rset);
		FD_SET(rtc, &rset);
		tv.tv_sec=0;
		tv.tv_usec=10000;
		rc=select(rtc+1, &rset, NULL, NULL, &tv);
	}	
	gettimeofday(&end, NULL);
	timersub(&end, &begin, &delta);
	printf("time %ld msec per test\n", (delta.tv_sec*1000+delta.tv_usec/1000)/ntests);
	return 0;
}

	



Youez - 2016 - github.com/yon3zu
LinuXploit