1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/system
Sebastiaan van Stijn 2c9684e35c
pkg/system: add note about maxTime
This code caused me some head-scratches, and initially I wondered
if this was a bug, but it looks to be intentional to set nsec, not
sec, as time.Unix() internally divides nsec, and sets sec accordingly;
https://github.com/golang/go/blob/go1.19.2/src/time/time.go#L1364-L1380

    // Unix returns the local Time corresponding to the given Unix time,
    // sec seconds and nsec nanoseconds since January 1, 1970 UTC.
    // It is valid to pass nsec outside the range [0, 999999999].
    // Not all sec values have a corresponding time value. One such
    // value is 1<<63-1 (the largest int64 value).
    func Unix(sec int64, nsec int64) Time {
        if nsec < 0 || nsec >= 1e9 {
            n := nsec / 1e9
            sec += n
            nsec -= n * 1e9
            if nsec < 0 {
                nsec += 1e9
                sec--
            }
        }
        return unixTime(sec, int32(nsec))
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-07 18:34:34 +02:00
..
args_windows.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
chtimes.go pkg/system: add note about maxTime 2022-10-07 18:34:34 +02:00
chtimes_linux_test.go Use syscall.Timespec.Unix 2022-01-03 16:51:02 +01:00
chtimes_nowindows.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
chtimes_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
chtimes_windows.go pkg/system: normalize comment formatting 2019-11-27 15:38:17 +01:00
chtimes_windows_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
errors.go Add canonical import comment 2018-02-05 16:51:57 -05:00
filesys.go pkg/system: make IsAbs() platform-agnostic 2022-08-27 15:11:27 +02:00
filesys_unix.go replace pkg/system Sequential funcs with moby/sys/sequential 2022-08-30 09:33:49 +02:00
filesys_windows.go replace pkg/system Sequential funcs with moby/sys/sequential 2022-08-30 09:33:49 +02:00
image_os.go system: remove LCOWSupported() utility 2021-07-27 13:36:19 +02:00
init_windows.go Windows CI: Add support for testing with containerd 2021-08-17 07:09:40 -07:00
lstat_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
lstat_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
lstat_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
meminfo.go Add canonical import comment 2018-02-05 16:51:57 -05:00
meminfo_linux.go pkg/*: fix "empty-lines" (revive) 2022-09-28 01:58:49 +02:00
meminfo_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
meminfo_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
meminfo_windows.go gofmt GoDoc comments with go1.19 2022-07-08 19:56:23 +02:00
mknod.go Port pkg/system/mknod.go to FreeBSD 2021-09-22 09:47:35 +03:00
mknod_freebsd.go Port pkg/system/mknod.go to FreeBSD 2021-09-22 09:47:35 +03:00
mknod_unix.go system: unbreak build for darwin 2021-12-15 22:15:07 -08:00
mknod_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
path.go pkg/*: fix "empty-lines" (revive) 2022-09-28 01:58:49 +02:00
path_unix.go pkg/containerfs: drop PathDriver abstraction 2022-09-23 16:25:22 -04:00
path_windows.go pkg/containerfs: drop PathDriver abstraction 2022-09-23 16:25:22 -04:00
path_windows_test.go pkg/containerfs: drop PathDriver abstraction 2022-09-23 16:25:22 -04:00
process_unix.go daemon: killWithSignal, killPossiblyDeadProcess: accept syscall.Signal 2022-05-05 00:53:52 +02:00
process_windows.go pkg/system: fix minor linting issues 2020-03-09 16:40:05 +01:00
stat_bsd.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
stat_darwin.go Add canonical import comment 2018-02-05 16:51:57 -05:00
stat_linux.go reformat "nolint" comments 2021-06-10 13:03:42 +02:00
stat_openbsd.go Add canonical import comment 2018-02-05 16:51:57 -05:00
stat_solaris.go Add solaris support to lstat 2020-08-12 11:40:58 +02:00
stat_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
stat_unix_test.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
stat_windows.go pkg/system: unconvert 2022-10-05 16:21:04 +02:00
utimes_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
utimes_unix_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
utimes_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
xattrs_linux.go pkg/system.getxattr: handle changed size case 2020-02-26 07:56:12 -08:00
xattrs_unsupported.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00