mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-23 02:50:29 +00:00
Make improvements
- Add rusage to redbean Lua API - Add more redbean documentation - Add pledge() to redbean Lua API - Polyfill OpenBSD pledge() for Linux - Increase PATH_MAX limit to 1024 characters - Untrack sibling processes after fork() on Windows
This commit is contained in:
parent
9a6bd304a5
commit
47b3274665
212 changed files with 2251 additions and 834 deletions
|
@ -292,10 +292,8 @@ update_tzname_etc(struct state const *sp, struct ttinfo const *ttisp)
|
|||
#if HAVE_TZNAME
|
||||
tzname[ttisp->tt_isdst] = (char *) &sp->chars[ttisp->tt_desigidx];
|
||||
#endif
|
||||
#if USG_COMPAT
|
||||
if (!ttisp->tt_isdst)
|
||||
timezone = - ttisp->tt_utoff;
|
||||
#endif
|
||||
#if ALTZONE
|
||||
if (ttisp->tt_isdst)
|
||||
altzone = - ttisp->tt_utoff;
|
||||
|
@ -311,10 +309,8 @@ settzname(void)
|
|||
#if HAVE_TZNAME
|
||||
tzname[0] = tzname[1] = (char *) (sp ? wildabbr : gmt);
|
||||
#endif
|
||||
#if USG_COMPAT
|
||||
daylight = 0;
|
||||
timezone = 0;
|
||||
#endif
|
||||
#if ALTZONE
|
||||
altzone = 0;
|
||||
#endif
|
||||
|
@ -333,10 +329,8 @@ settzname(void)
|
|||
&sp->ttis[
|
||||
sp->types[i]];
|
||||
update_tzname_etc(sp, ttisp);
|
||||
#if USG_COMPAT
|
||||
if (ttisp->tt_isdst)
|
||||
daylight = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ hidden extern const unsigned short kMonthYearDay[2][12];
|
|||
|
||||
extern char *tzname[2];
|
||||
extern long CLOCKS_PER_SEC;
|
||||
extern long timezone;
|
||||
extern int daylight;
|
||||
|
||||
int64_t clock(void);
|
||||
int64_t time(int64_t *);
|
||||
|
|
23
libc/time/timezone.c
Normal file
23
libc/time/timezone.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Copyright 2022 Justine Alexandra Roberts Tunney │
|
||||
│ │
|
||||
│ Permission to use, copy, modify, and/or distribute this software for │
|
||||
│ any purpose with or without fee is hereby granted, provided that the │
|
||||
│ above copyright notice and this permission notice appear in all copies. │
|
||||
│ │
|
||||
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
|
||||
│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
|
||||
│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
|
||||
│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
|
||||
│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
|
||||
│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/time/time.h"
|
||||
|
||||
char *tzname[2];
|
||||
long timezone;
|
||||
int daylight;
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_TZ_PRIVATE_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_TZ_PRIVATE_H_
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/inttypes.h"
|
||||
|
@ -8,6 +9,7 @@
|
|||
#include "libc/sysv/consts/ok.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/* clang-format off */
|
||||
/* Private header for tzdb code. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue