Revert "Remove ftime from bionic LP64"
Breaking some build... will look in to it later.
This reverts commit 26d6799bbe.
Change-Id: I35fa770221be3a181bd37c6c3dce1bf37a69a4a1
This commit is contained in:
@@ -226,35 +226,4 @@ extern "C" wchar_t* wcswcs(wchar_t* haystack, wchar_t* needle) {
|
||||
return wcsstr(haystack, needle);
|
||||
}
|
||||
|
||||
// Only used by ftime, which was removed from POSIX.
|
||||
struct timeb {
|
||||
time_t time;
|
||||
unsigned short millitm;
|
||||
short timezone;
|
||||
short dstflag;
|
||||
};
|
||||
|
||||
// This was removed from POSIX.
|
||||
extern "C" int ftime(struct timeb* tb)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
|
||||
if (gettimeofday(&tv, &tz) < 0)
|
||||
return -1;
|
||||
|
||||
tb->time = tv.tv_sec;
|
||||
tb->millitm = (tv.tv_usec + 500) / 1000;
|
||||
|
||||
if (tb->millitm == 1000) {
|
||||
++tb->time;
|
||||
tb->millitm = 0;
|
||||
}
|
||||
|
||||
tb->timezone = tz.tz_minuteswest;
|
||||
tb->dstflag = tz.tz_dsttime;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user