1// Copyright 2023 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 unix 6 7package runtime 8 9const ( 10 // These values are the same on all known Unix systems. 11 // If we find a discrepancy some day, we can split them out. 12 _F_SETFD = 2 13 _FD_CLOEXEC = 1 14) 15 16//go:nosplit 17func closeonexec(fd int32) { 18 fcntl(fd, _F_SETFD, _FD_CLOEXEC) 19} 20