git.cappig.dev / apheleiaOS.git master

1
#pragma once
2
3
#include <stddef.h>
4
5
typedef long int time_t;
6
typedef int clockid_t;
7
8
struct timespec {
9
    time_t tv_sec;
10
    long tv_nsec;
11
};
12
13
#define CLOCK_REALTIME  0
14
#define CLOCK_MONOTONIC 1
15
16
struct tm {
17
    int tm_sec;
18
    int tm_min;
19
    int tm_hour;
20
    int tm_mday;
21
    int tm_mon;
22
    int tm_year;
23
    int tm_wday;
24
    int tm_yday;
25
    int tm_isdst;
26
};
27
28
time_t time(time_t *timer);
29
int nanosleep(const struct timespec *req, struct timespec *rem);
30
int clock_gettime(clockid_t clock_id, struct timespec *tp);
31
32
time_t mktime(struct tm *tm);
33
34
struct tm *gmtime_r(const time_t *timer, struct tm *result);
35
struct tm *gmtime(const time_t *timer);
36
struct tm *localtime_r(const time_t *timer, struct tm *result);
37
struct tm *localtime(const time_t *timer);
38
39
size_t strftime(char *str, size_t max, const char *format, const struct tm *tm);
40
41
char *asctime(const struct tm *time);
42
char *ctime(const time_t *timer);