0

I have a hard time to resolve a problem with time.h includes and I noticed that there are two include directories with some overlapping header files: /usr/include/arm-linux-gnueabihf/sys and /usr/include/arm-linux-gnueabihf/bits

what is the difference, when I need to use ..../bits and when ..../sys?

0

when I need to use ..../bits and when ..../sys

Neither. Just use:

#include <time.h>

This will source /usr/include/time.h, which sources the bits one directly, and probably indirectly sources the sys one too. In any case, the standard C time functions are declared in the toplevel header and for predictable results, stick with that.

The purpose of this hierarchy is that /usr/include/time.h can be the same regardless of hardware architecture, and the implementation specific bits are further down so user code does not have to be concerned with them. This is part of what makes C a high level portable language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.