mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibC: Time-related POSIX compliance fixes.
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
int gettimeofday(struct timeval* __restrict__, void* __restrict__) __attribute__((nonnull(1)));
|
||||||
|
|
||||||
|
__END_DECLS
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <Kernel/Syscall.h>
|
#include <Kernel/Syscall.h>
|
||||||
@@ -16,7 +17,7 @@ time_t time(time_t* tloc)
|
|||||||
return tv.tv_sec;
|
return tv.tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gettimeofday(struct timeval* tv, struct timezone*)
|
int gettimeofday(struct timeval* __restrict__ tv, void* __restrict__)
|
||||||
{
|
{
|
||||||
int rc = syscall(SC_gettimeofday, tv);
|
int rc = syscall(SC_gettimeofday, tv);
|
||||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ extern long altzone;
|
|||||||
extern char* tzname[2];
|
extern char* tzname[2];
|
||||||
extern int daylight;
|
extern int daylight;
|
||||||
|
|
||||||
int gettimeofday(struct timeval*, struct timezone* tz);
|
typedef uint32_t clock_t;
|
||||||
|
typedef uint32_t time_t;
|
||||||
|
|
||||||
struct tm* localtime(const time_t*);
|
struct tm* localtime(const time_t*);
|
||||||
struct tm *gmtime(const time_t*);
|
struct tm *gmtime(const time_t*);
|
||||||
time_t mktime(struct tm*);
|
time_t mktime(struct tm*);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <LibGUI/GElapsedTimer.h>
|
#include <LibGUI/GElapsedTimer.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
void GElapsedTimer::start()
|
void GElapsedTimer::start()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <LibC/time.h>
|
#include <LibC/time.h>
|
||||||
#include <LibC/sys/select.h>
|
#include <LibC/sys/select.h>
|
||||||
#include <LibC/sys/socket.h>
|
#include <LibC/sys/socket.h>
|
||||||
|
#include <LibC/sys/time.h>
|
||||||
#include <LibC/errno.h>
|
#include <LibC/errno.h>
|
||||||
#include <LibC/string.h>
|
#include <LibC/string.h>
|
||||||
#include <LibC/stdlib.h>
|
#include <LibC/stdlib.h>
|
||||||
|
|||||||
@@ -9,8 +9,9 @@
|
|||||||
#include <Kernel/MousePacket.h>
|
#include <Kernel/MousePacket.h>
|
||||||
#include <LibC/sys/socket.h>
|
#include <LibC/sys/socket.h>
|
||||||
#include <LibC/sys/select.h>
|
#include <LibC/sys/select.h>
|
||||||
#include <LibC/unistd.h>
|
#include <LibC/sys/time.h>
|
||||||
#include <LibC/time.h>
|
#include <LibC/time.h>
|
||||||
|
#include <LibC/unistd.h>
|
||||||
#include <LibC/fcntl.h>
|
#include <LibC/fcntl.h>
|
||||||
#include <LibC/stdio.h>
|
#include <LibC/stdio.h>
|
||||||
#include <LibC/errno.h>
|
#include <LibC/errno.h>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/ip_icmp.h>
|
#include <netinet/ip_icmp.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user