diff --git a/aarch64/corefreq-cli.c b/aarch64/corefreq-cli.c index b3973101..5993a150 100644 --- a/aarch64/corefreq-cli.c +++ b/aarch64/corefreq-cli.c @@ -9285,7 +9285,11 @@ Window *PopUpMessage(ASCII *title, RING_CTRL *pCtrl) if (pCtrl->drc < RC_DRIVER_BASE) { + #ifdef __GLIBC__ sysMsg = strerror_r(pCtrl->drc, inStr, POPUP_ALLOC); + #else + sysMsg = strerror(pCtrl->drc); + #endif switch ( GET_LOCALE() ) { case LOC_FR: /* Convert the System message to locale */ ISO_8859_To_Unicode((ASCII *) sysMsg, (ASCII *) inStr); diff --git a/aarch64/corefreq-ui.c b/aarch64/corefreq-ui.c index cd7b2bca..34e40c03 100644 --- a/aarch64/corefreq-ui.c +++ b/aarch64/corefreq-ui.c @@ -2225,7 +2225,11 @@ void _LOCALE_IN(void) SysLoc = newlocale(LC_MESSAGES_MASK, "", (locale_t) 0); if (SysLoc != NULL) { + #ifdef __GLIBC__ const char *s18n = SysLoc->__names[5]; + #else + const char *s18n = "en_US.UTF-8"; + #endif struct LOCALE_LOOKUP *lookUp = LocaleLookUp; while (lookUp->i18n != NULL) { I18N *i18n = lookUp->i18n; diff --git a/aarch64/corefreq.h b/aarch64/corefreq.h index e8dc15d3..24b0fedc 100644 --- a/aarch64/corefreq.h +++ b/aarch64/corefreq.h @@ -204,11 +204,18 @@ typedef struct unsigned long long Error; + #ifdef __GLIBC__ struct { struct random_data data; char state[128]; int value[2]; } Random; + #else + struct { + char state[128]; + int value[2]; + } Random; + #endif /* __GLIBC__ */ struct { unsigned long long inside, diff --git a/aarch64/corefreqd.c b/aarch64/corefreqd.c index ab246f0e..89df6d36 100644 --- a/aarch64/corefreqd.c +++ b/aarch64/corefreqd.c @@ -437,8 +437,12 @@ void SliceScheduling( RO(SHM_STRUCT) *RO(Shm), break; case RAND_SMT: do { + #ifdef __GLIBC__ if (random_r(&RO(Shm)->Cpu[cpu].Slice.Random.data, &RO(Shm)->Cpu[cpu].Slice.Random.value[0]) == 0) + #else + RO(Shm)->Cpu[cpu].Slice.Random.value[0] = (int) random(); + #endif /* __GLIBC__ */ { seek = RO(Shm)->Cpu[cpu].Slice.Random.value[0] % RO(Shm)->Proc.CPU.Count; @@ -1563,7 +1567,11 @@ REASON_CODE Core_Manager(REF *Ref) unsigned int cpu = 0; pthread_t tid = pthread_self(); + #ifdef __GLIBC__ RO(Shm)->App.Svr = tid; + #else + RO(Shm)->App.Svr = getpid(); + #endif if (ServerFollowService(&localService, &RO(Shm)->Proc.Service, tid) == 0) { pthread_setname_np(tid, "corefreqd-pmgr"); @@ -1977,11 +1985,14 @@ REASON_CODE Child_Manager(REF *Ref) : : ); + #ifdef __GLIBC__ initstate_r( seed32, RO(Shm)->Cpu[cpu].Slice.Random.state, sizeof(RO(Shm)->Cpu[cpu].Slice.Random.state), &RO(Shm)->Cpu[cpu].Slice.Random.data ); - + #else + initstate(seed32, RO(Shm)->Cpu[cpu].Slice.Random.state, 128); + #endif if (!Arg[cpu].TID) { /* Add this child thread. */ Arg[cpu].Ref = Ref; diff --git a/aarch64/corefreqm.c b/aarch64/corefreqm.c index d4bae3cb..a7445664 100644 --- a/aarch64/corefreqm.c +++ b/aarch64/corefreqm.c @@ -234,11 +234,15 @@ void Slice_Monte_Carlo(RO(SHM_STRUCT) *RO(Shm), RW(SHM_STRUCT) *RW(Shm), { double X, Y, Z; UNUSED(arg); - + #ifdef __GLIBC__ if (!random_r( &RO(Shm)->Cpu[cpu].Slice.Random.data, &RO(Shm)->Cpu[cpu].Slice.Random.value[0] ) && !random_r( &RO(Shm)->Cpu[cpu].Slice.Random.data, &RO(Shm)->Cpu[cpu].Slice.Random.value[1] )) + #else + RO(Shm)->Cpu[cpu].Slice.Random.value[0] = (int) random(); + RO(Shm)->Cpu[cpu].Slice.Random.value[1] = (int) random(); + #endif /* __GLIBC__ */ { X = (double) RO(Shm)->Cpu[cpu].Slice.Random.value[0] / RAND_MAX; Y = (double) RO(Shm)->Cpu[cpu].Slice.Random.value[1] / RAND_MAX;