diff options
author | Wim <wim@42.be> | 2023-08-05 20:43:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-05 20:43:19 +0200 |
commit | 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (patch) | |
tree | b1355645342667209263cbd355dc0b4254f1e8fe /vendor/modernc.org/libc/libc_linux.go | |
parent | 9459495484d6e06a3d46de64fccd8d06f7ccc72c (diff) | |
download | matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.gz matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.bz2 matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.zip |
Diffstat (limited to 'vendor/modernc.org/libc/libc_linux.go')
-rw-r--r-- | vendor/modernc.org/libc/libc_linux.go | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/vendor/modernc.org/libc/libc_linux.go b/vendor/modernc.org/libc/libc_linux.go index 1c2f4826..08f67be8 100644 --- a/vendor/modernc.org/libc/libc_linux.go +++ b/vendor/modernc.org/libc/libc_linux.go @@ -133,11 +133,7 @@ var localtime ctime.Tm // struct tm *localtime(const time_t *timep); func Xlocaltime(_ *TLS, timep uintptr) uintptr { - loc := time.Local - if r := getenv(Environ(), "TZ"); r != 0 { - zone, off := parseZone(GoString(r)) - loc = time.FixedZone(zone, -off) - } + loc := getLocalLocation() ut := *(*unix.Time_t)(unsafe.Pointer(timep)) t := time.Unix(int64(ut), 0).In(loc) localtime.Ftm_sec = int32(t.Second()) @@ -154,11 +150,7 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr { // struct tm *localtime_r(const time_t *timep, struct tm *result); func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { - loc := time.Local - if r := getenv(Environ(), "TZ"); r != 0 { - zone, off := parseZone(GoString(r)) - loc = time.FixedZone(zone, -off) - } + loc := getLocalLocation() ut := *(*unix.Time_t)(unsafe.Pointer(timep)) t := time.Unix(int64(ut), 0).In(loc) (*ctime.Tm)(unsafe.Pointer(result)).Ftm_sec = int32(t.Second()) @@ -645,16 +637,6 @@ func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { return Xsetrlimit64(t, resource, rlim) } -// int setrlimit(int resource, const struct rlimit *rlim); -func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { - if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { - t.setErrno(err) - return -1 - } - - return 0 -} - // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { return types.Uid_t(os.Getuid()) |