Question

I'm trying to compile Evas for the host mipsel-linux-uclibc. I'm using an old binary toolchain from my company to do it. It was compiled around 2008 and I'm kinda stuck with it right now. Looks like this toolchain is missing the following field in the struct stat of stat.h:

unsigned long int st_mtimensec; /* Nsecs of last modification.  */

The closest thing that I have is:

__time_t st_mtime;      /* Time of last modification.  */

Looks like this is related to uclibc. Is there an easy way out of this?

Was it helpful?

Solution

struct stat is supposed to contain a member struct timespec st_mtim; and stat.h is supposed to #define st_mtime st.mtim.tv_sec. If your uClibc is too old to have these right, you could try hacking them into the header (there's probably just a time_t st_mtime; member and a padding member next to it where the nanoseconds should be). The important thing is that you must keep the layout of the members (their offsets in the structure) the same or things will horribly break.

A better question might be why Evas isn't portable to older (pre-POSIX-2008) systems, and why it's using the wrong name for the nanoseconds field (the correct name is st_mtim.tv_nsec, not st_mtimensec. The most beneficial course of action would probably be to get these fixes upstream in Evas so other users won't encounter problems in the future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top