Skip to content

Commit

Permalink
Kernel+LibC+Userland: Switch to 64-bit time_t
Browse files Browse the repository at this point in the history
Let's not have that 2038 problem people are talking about. :^)
  • Loading branch information
awesomekling committed Jan 27, 2020
1 parent 6906ede commit 23ffd6c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Kernel/FileSystem/DiskBackedFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//#define DBFS_DEBUG

struct CacheEntry {
u32 timestamp { 0 };
time_t timestamp { 0 };
u32 block_index { 0 };
u8* data { nullptr };
bool has_data { false };
Expand Down
2 changes: 1 addition & 1 deletion Kernel/UnixTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ struct sigaction {
#define OFF_T_MAX 2147483647

typedef i32 off_t;
typedef u32 time_t;
typedef i64 time_t;

struct utimbuf {
time_t actime;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibC/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef uint16_t mode_t;
typedef uint32_t nlink_t;
typedef uint32_t blksize_t;
typedef uint32_t blkcnt_t;
typedef uint32_t time_t;
typedef int64_t time_t;
typedef uint32_t useconds_t;
typedef int32_t suseconds_t;
typedef uint32_t clock_t;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibC/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern char* tzname[2];
extern int daylight;

typedef uint32_t clock_t;
typedef uint32_t time_t;
typedef int64_t time_t;

struct tm* localtime(const time_t*);
struct tm* gmtime(const time_t*);
Expand Down
2 changes: 1 addition & 1 deletion Userland/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char** argv)
time_t now = time(nullptr);

if (argc == 2 && !strcmp(argv[1], "-u")) {
printf("%u\n", now);
printf("%lld\n", now);
return 0;
}

Expand Down

0 comments on commit 23ffd6c

Please sign in to comment.