4

Writing on a small c programm that somewhere calls a method that has a pwrite() in it.

I now wanted to know how long that method takes.
So I add a:
startTime = clock();
In front of it.
The funny thing is, that makes the pwrite fail.
I remove it, it works.
I add it, and it fails again.

What the actual fucking hell.

Comments
  • 2
    Probably undefined behaviour somewhere in the program. Try compiling with -Wall -Wextra and fix all warnings.
  • 0
    @Fast-Nop well, thanks, but nothing that'd explain what's going on.

    Clion sometimes bugs out and thinks I have declared something as u_int but its getting a char**, which isn't the case.

    Saving the header manually fixes it until it bugs out again.

    Soooo, yea.
  • 0
    What I mean, is, the only difference between the pwrite successfully writing and it failing is the call to clock()

    So in pseudoCode, not working:
    time = clock();
    methodThatCallsPWrite();

    And just to have mentioned it, nothing segfaults.
Add Comment