src/cmd/internal/robustio/robustio_darwin.go
raw| 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. |
| 4 | |
| 5 | package robustio |
| 6 | |
| 7 | import ( |
| 8 | "errors" |
| 9 | "syscall" |
| 10 | ) |
| 11 | |
| 12 | const errFileNotFound = syscall.ENOENT |
| 13 | |
| 14 | // isEphemeralError returns true if err may be resolved by waiting. |
| 15 | func isEphemeralError(err error) bool { |
| 16 | errno, ok := errors.AsType[syscall.Errno](err) |
| 17 | return ok && errno == errFileNotFound |
| 18 | } |