]> Cypherpunks repositories - gostls13.git/commit
syscall: redirect writes to runtime.write in faketime mode
authorAustin Clements <austin@google.com>
Sun, 1 Sep 2019 18:19:19 +0000 (14:19 -0400)
committerAustin Clements <austin@google.com>
Wed, 4 Sep 2019 17:56:17 +0000 (17:56 +0000)
commit0607cdda6b9f978b268464e9a42630c702dbd833
treed4cc848f52d648511ec72e6f0fd80cd039aa3a4a
parent4af3c17f8cd37288a5bb9bc53e8b88c58f5624d1
syscall: redirect writes to runtime.write in faketime mode

If the faketime build tag is set, this causes syscall.Write for FDs 1
and 2 to redirect to runtime.write, since that's where we'll apply the
faketime framing. This is equivalent to what nacl currently does in
naclFile.write.

We do this on all of the platforms except nacl, which has its own
faketime support and we're about to remove, and Windows, which would
require other changes to support faketime so we're leaving alone for
now.

Updates #30439.

Change-Id: I138a5ca63577d92d15b5437d037bd3159fa84ee7
Reviewed-on: https://go-review.googlesource.com/c/go/+/192739
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/fs_js.go
src/syscall/syscall_plan9.go
src/syscall/syscall_unix.go
src/syscall/time_fake.go [new file with mode: 0644]
src/syscall/time_nofake.go [new file with mode: 0644]