Now write actual intervals instead of arbitrary values

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 2 years ago
parent 0996dc4e7c
commit 258c2ab6b8
  1. 6
      main.c
  2. BIN
      memovr

@ -63,14 +63,14 @@ int main(int argc,char**argv) {
lseek(fd_proc_mem,addr,SEEK_SET); lseek(fd_proc_mem,addr,SEEK_SET);
read(fd_proc_mem,buf,sizeof(unsigned int)); read(fd_proc_mem,buf,sizeof(unsigned int));
while (1) { while (1) {
sprintf(buf,"%d",(int)val++); sprintf(buf,"%d",(int)val);
lseek(fd_proc_mem,addr,SEEK_SET); lseek(fd_proc_mem,addr,SEEK_SET);
if (write(fd_proc_mem,buf,sizeof(unsigned int))==-1) { if (write(fd_proc_mem,buf,sizeof(unsigned int))==-1) {
printf("Error while writing\n"); printf("Error while writing\n");
exit(1); exit(1);
} }
printf("\nWrite %d",(int)val-1); printf("\nWrite %d",(int)val);
sleep(2); sleep(((double)interval/1000));
} }
free(buf); free(buf);

BIN
memovr

Binary file not shown.
Loading…
Cancel
Save