Skip to content

x/sys: ClockSetttime function missing #69830

Closed

Description

@yrk-lab

Go version

go version go1.23.2 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN='/home/user/bin'
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/user/fbsource/third-party/go/1.23.2/linux_amd64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/user/fbsource/third-party/go/1.23.2/linux_amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2144852328=/tmp/go-build -gno-record-gcc-switches'

What did you do?

https://go.dev/play/p/o-6Fj2boHM-

package main

import (
	"fmt"
	"log"
	"time"

	"golang.org/x/sys/unix"
)

func main() {
	t := time.Unix(1728509438, 0)
	ts, err := unix.TimeToTimespec(t)
	if err != nil {
		log.Fatal(err)
	}
	if err := unix.ClockSettime(unix.CLOCK_REALTIME, &ts); err != nil {
		log.Fatal(err)
	}
	fmt.Println("ok")
}

What did you see happen?

./prog.go:19:17: undefined: unix.ClockSettime

What did you expect to see?

An ok, or at least an error like EPERM.

Activity

  1. added this to the Unreleased milestone on Oct 9, 2024
  2. gopherbot commented on Oct 10, 2024

    @gopherbot
    Contributor

    Change https://go.dev/cl/619255 mentions this issue: unix: add ClockSettime on Linux

  3. added a commit that references this issue on Oct 12, 2024
    fe162ba
  4. locked and limited conversation to collaborators on Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions