Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / syscall / time_fake.go
blob5dec57a25acc496d417dae4ef8481156e7305761
1 // Copyright 2019 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.
5 // +build faketime
7 package syscall
9 import "unsafe"
11 const faketime = true
13 // When faketime is enabled, we redirect writes to FDs 1 and 2 through
14 // the runtime's write function, since that adds the framing that
15 // reports the emulated time.
17 //go:linkname runtimeWrite runtime.write
18 func runtimeWrite(fd uintptr, p unsafe.Pointer, n int32) int32
20 func faketimeWrite(fd int, p []byte) int {
21 var pp *byte
22 if len(p) > 0 {
23 pp = &p[0]
25 return int(runtimeWrite(uintptr(fd), unsafe.Pointer(pp), int32(len(p))))