8000 Comparing b06ce05...1edeebe · golang/sys · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: golang/sys
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b06ce05
Choose a base ref
...
head repository: golang/sys
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1edeebe
Choose a head ref
  • 7 commits
  • 12 files changed
  • 6 contributors

Commits on Sep 17, 2025

  1. sys: add support for NetBSD getvfsstat

    NetBSD replaced the getfsstat interface with getvfsstat in NetBSD 3.0.
    
    Add a test for it.
    
    With help from Benny Siegert and Ian Lance Taylor.
    
    Change-Id: I115ae48c287cc32181006e9e8f7c15851e7e36c0
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/550476
    Reviewed-by: Cherry Mui <cherryyz@google.com>
    Reviewed-by: Ian Lance Taylor <iant@golang.org>
    Reviewed-by: Benny Siegert <bsiegert@gmail.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Auto-Submit: Benny Siegert <bsiegert@gmail.com>
    Auto-Submit: Ian Lance Taylor <iant@golang.org>
    0-wiz-0 authored and gopherbot committed Sep 17, 2025
    Configuration menu
    Copy the full SHA
    137f2ed View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2025

  1. unix: use Go 1.21+ clear built-in

    Inspired by CL 698495.
    
    Change-Id: Ic6ff68a60d41b6ffb6a28f523597c5d36c1e4d2f
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/704915
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
    Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
    Reviewed-by: Sean Liao <sean@liao.dev>
    Reviewed-by: Mark Freeman <markfreeman@google.com>
    kolyshkin authored and tklauser committed Sep 18, 2025
    Configuration menu
    Copy the full SHA
    32e2038 View commit details
    Browse the repository at this point in the history
  2. windows: add FlushConsoleInputBuffer and GetNumberOfConsoleInputEvents

    This adds syscall wrappers for FlushConsoleInputBuffer and GetNumberOfConsoleInputEvents on Windows.
    
    Change-Id: I2365aebc42a57f83cfc951e10520270e1f3e0606
    GitHub-Last-Rev: 1f711a5
    GitHub-Pull-Request: #264
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/704715
    Reviewed-by: Mark Freeman <markfreeman@google.com>
    Auto-Submit: Sean Liao <sean@liao.dev>
    Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Michael Knyszek <mknyszek@google.com>
    aymanbagabas authored and gopherbot committed Sep 18, 2025
    Configuration menu
    Copy the full SHA
    6be6c58 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2025

  1. unix: add (*CPUSet).Fill helper to enable all CPUs

    Some programs (such as container runtimes) want to reset their CPU
    affinity if they are spawned by processes with a particular CPU
    affinity. Container runtimes didn't really have to deal with this issue
    until Linux 6.2 when the cpuset cgroup was changed to no longer
    auto-reset CPU affinity in this case.
    
    A naive approach to resetting your CPU affinity would be to get the
    number of CPUs by looking at "/proc/stat" or "/sys/devices/system/cpu"
    (note that runtime.NumCPU() actually returns the CPU affinity of the
    process at startup time, which isn't useful for this purpose) and then
    asking for all of those CPUs.
    
    However, sched_setaffinity(2) will silently ignore any CPU bits set in
    the provided CPUSet if they do not exist or are not enabled in the
    cpuset cgroup of the process. This means that you can reset your CPU
    affinity by just setting every CPU bit in CPUSet and passing it to
    sched_setaffinity(2).
    
    Unfortunately, setting every CPU bit in CPUSet with (*CPUSet).Set() is
    very inefficient. If it were possible to just memset(0xFF) the CPUSet
    array, users would be able to reset their CPU affinity even more
    cheaply. However, Go doesn't have a memset primitive that can be used in
    that way.
    
    Obvious solutions like setting the array elements of CPUSet to (^0) do
    not work because CPUSet is an array of a private newtype and so the
    compiler complains if you try to use a constant like (^0) without a
    cast (and we cannot use a cast because the type is private):
    
        cannot use ^0 (untyped int constant -1) as
        "golang.org/x/sys/unix".cpuMask value in assignment (overflows)
    
    The only real alternative is to do something quite hacky like:
    
        cpuset := unix.CPUSet{}
        for i := range cpuset {
            cpuset[i]-- // underflow to 0xFF..FF
        }
    
    ... which is the solution we use in runc.
    
    It would be much nicer to have a helper that does this memset for us in
    a less hacky way, since resetting CPU affinity seems like a fairly
    common operation.
    
    Ref: Linux kernel commit da019032819a ("sched: Enforce user requested affinity")
    Fixes golang/go#75186
    
    Change-Id: I211ddeafd54ce35079a67493123d28e1bb76966a
    GitHub-Last-Rev: 71871db
    GitHub-Pull-Request: #259
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/698015
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
    Reviewed-by: Junyang Shao <shaojunyang@google.com>
    Reviewed-by: Cherry Mui <cherryyz@google.com>
    cyphar authored and cherrymui committed Sep 26, 2025
    Configuration menu
    Copy the full SHA
    033906b View commit details
    Browse the repository at this point in the history
  2. windows: export O_FILE_FLAG_* to be used in os.OpenFile on windows

    These file flags are supported by os.OpenFile since CL 699415.
    
    Closes golang/go#73676
    
    Change-Id: Iaf846c9cb98c1458bbc30d05ad8a331ef1f332df
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/700975
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    Reviewed-by: Junyang Shao <shaojunyang@google.com>
    qmuntal committed Sep 26, 2025
    Configuration menu
    Copy the full SHA
    5e63aa5 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2025

  1. unix: use slices.{Equal,Sort} in tests

    Same as CL 587655 and CL 690475 did for package syscall tests.
    
    Change-Id: Ie3c8726a4e2c859b5d7992ea1baec14083b9fdba
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/708558
    Reviewed-by: Junyang Shao <shaojunyang@google.com>
    Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
    Reviewed-by: Carlos Amedee <carlos@golang.org>
    Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Sean Liao <sean@liao.dev>
    tklauser authored and gopherbot committed Oct 2, 2025
    Configuration menu
    Copy the full SHA
    ecada54 View commit details
    Browse the repository at this point in the history
  2. unix: mkall.sh: fail if docker build failed

    When docker build fails, docker run (in my case podman) tries to find
    the generate:linux image from various mirrors, which is very confusing.
    We should error out if docker build fails.
    
    Change-Id: I4fd78e9fa339e03029b1bf003b3239ca23a7ed1b
    Reviewed-on: https://go-review.googlesource.com/c/sys/+/706916
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Auto-Submit: Kirill Kolyshkin <kolyshkin@gmail.com>
    Reviewed-by: Junyang Shao <shaojunyang@google.com>
    Reviewed-by: Sean Liao <sean@liao.dev>
    Reviewed-by: Carlos Amedee <carlos@golang.org>
    kolyshkin committed Oct 2, 2025
    Configuration menu
    Copy the full SHA
    1edeebe View commit details
    Browse the repository at this point in the history
Loading
0