dMZX Forums: gettimeofday() and time() return a UNIX timestamp of -1. -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 857 Title gettimeofday() and time() return a UNIX timestamp of -1.
Product Archived MegaZeux Bugs Status Fixed (Severity 1 - Low)
Version 2.93 Fixed in 2.93b
Introduced In Version 2.93Operating System DOS

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #857: gettimeofday() and time() return a UNIX timestamp of -1.

#1 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,933
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 19 May 2024 - 07:27 PM

As has been observed multiple times, the DATE and TIME counters do not work in DOSBox and DOSBox-X. This is caused by gettimeofday() returning a tv.tv_sec value of -1 (actually UINT_MAX because time_t is unsigned for DJGPP). This results in the DATE and TIME counters being stuck at 2168-02-04 00:42:27. TIME_MILLIS, which uses tv.tv_usec, works as expected.

The upper half of the random seed is also initialized to -1. It is generated by calling time(NULL) directly.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 2)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,933
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 19 May 2024 - 08:11 PM

Updating status to: Fixed
Issue fixed in: 2.93b

DJGPP requires the environment variable TZ to be initialized before it will return useful date/time values for no good reason. Fixed in GIT d3a251df by making MegaZeux set TZ if it is unset during platform init.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,963
  • Joined: 12-October 00
  • Gender:Male

Posted 12 September 2024 - 06:19 PM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

1 User(s) are reading this issue
1 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.