github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/os/exec/exec_linux_test.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build linux && cgo
     6  
     7  // On systems that use glibc, calling malloc can create a new arena,
     8  // and creating a new arena can read /sys/devices/system/cpu/online.
     9  // If we are using cgo, we will call malloc when creating a new thread.
    10  // That can break TestExtraFiles if we create a new thread that creates
    11  // a new arena and opens the /sys file while we are checking for open
    12  // file descriptors. Work around the problem by creating threads up front.
    13  // See issue 25628.
    14  
    15  package exec_test