Remove ftime from bionic LP64

Bug: 13935372
Change-Id: I5dd31147143b23a090a3b75b846dc5354e599121
This commit is contained in:
Dan Albert
2014-06-04 15:20:17 -07:00
parent 623dce3bd4
commit 26d6799bbe
4 changed files with 31 additions and 97 deletions

View File

@@ -226,4 +226,35 @@ 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