Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <time.h>
  5.  
  6. int main( void )
  7. {
  8. struct timespec stime;
  9.  
  10. if( clock_gettime( CLOCK_REALTIME, &stime) == -1 ) {
  11. perror( "getclock" );
  12. exit( EXIT_FAILURE );
  13. }
  14.  
  15. stime.tv_sec += (60*60)*24L; /* Add one day */
  16. stime.tv_nsec = 0;
  17. if( clock_settime( CLOCK_REALTIME, &stime) == -1 ) {
  18. perror( "setclock" );
  19. exit( EXIT_FAILURE );
  20. }
  21. return( EXIT_SUCCESS );
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement