Brad Fitzpatrick | 5194744 | 2016-03-01 22:57:46 +0000 | [diff] [blame] | 1 | // Copyright 2013 The Go Authors. All rights reserved. |
Dave Cheney | 7c8280c | 2014-02-25 09:47:42 -0500 | [diff] [blame] | 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 syscall |
| 6 | |
| 7 | type Timespec struct { |
| 8 | Sec int64 |
| 9 | Nsec int32 |
| 10 | } |
| 11 | |
| 12 | type Timeval struct { |
| 13 | Sec int64 |
| 14 | Usec int32 |
| 15 | } |
| 16 | |
Ian Lance Taylor | 6c517df | 2016-10-11 21:04:16 -0700 | [diff] [blame] | 17 | func setTimespec(sec, nsec int64) Timespec { |
| 18 | return Timespec{Sec: sec, Nsec: int32(nsec)} |
Dave Cheney | 7c8280c | 2014-02-25 09:47:42 -0500 | [diff] [blame] | 19 | } |
| 20 | |
Ian Lance Taylor | 6c517df | 2016-10-11 21:04:16 -0700 | [diff] [blame] | 21 | func setTimeval(sec, usec int64) Timeval { |
| 22 | return Timeval{Sec: sec, Usec: int32(usec)} |
Dave Cheney | 7c8280c | 2014-02-25 09:47:42 -0500 | [diff] [blame] | 23 | } |