Skip to content

Instantly share code, notes, and snippets.

@zhangyoufu
Created May 2, 2018 10:24
Show Gist options
  • Select an option

  • Save zhangyoufu/14942cae6d094ed53ce08a7169c03615 to your computer and use it in GitHub Desktop.

Select an option

Save zhangyoufu/14942cae6d094ed53ce08a7169c03615 to your computer and use it in GitHub Desktop.
ctime of /dev/null
package main
import (
"fmt"
"syscall"
"time"
"unsafe"
)
const sys_fstat = 17
func main() {
var st syscall.Stat_t
syscall.Syscall(sys_fstat, 0, uintptr(unsafe.Pointer(&st)), 0)
fmt.Println(time.Unix(st.Ctime, 0))
}
// random comment to bypass caching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment