Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FreeBSD] Fix FreeBSD build/support #1075

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/FoundationEssentials/ProcessInfo/ProcessInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ final class _ProcessInfo: Sendable {
var ullTime: ULONGLONG = 0
QueryUnbiasedInterruptTimePrecise(&ullTime)
let time: UInt64 = ullTime
#elseif os(FreeBSD) || os(OpenBSD)
var ts: timespec = timespec()
clock_gettime(CLOCK_MONOTONIC, &ts)
let time: UInt64 = UInt64(ts.tv_sec) * 1000000000 + UInt64(ts.tv_nsec)
#else
var ts: timespec = timespec()
#if os(Linux)
clock_gettime(CLOCK_MONOTONIC_RAW, &ts)
#else
clock_gettime(CLOCK_MONOTONIC, &ts)
#endif
let time: UInt64 = UInt64(ts.tv_sec) * 1000000000 + UInt64(ts.tv_nsec)
#endif
michael-yuji marked this conversation as resolved.
Show resolved Hide resolved
let timeString = String(time, radix: 16, uppercase: true)
Expand Down