Skip to content
Draft
Show file tree
Hide file tree
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
Prev Previous commit
Sketch: Introduce SystemConfig
  • Loading branch information
milseman committed Mar 15, 2021
commit 6813ed3ebe404b3b03cb7638aae1594acd3b455f
27 changes: 27 additions & 0 deletions Sources/System/Internals/Syscalls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,30 @@ internal func system_dup2(_ fd: Int32, _ fd2: Int32) -> Int32 {
#endif
return dup2(fd, fd2)
}

internal func system_sysconf(_ name: CInt) -> Int {
#if ENABLE_MOCKING
if mockingEnabled { return _mockInt(name) }
#endif
return sysconf(name)
}

internal func system_pathconf(
_ path: UnsafePointer<CChar>, _ name: CInt
) -> Int {
#if ENABLE_MOCKING
if mockingEnabled {
return _mockInt(path: path, name)
}
#endif
return pathconf(path, name)
}

internal func system_fpathconf(
_ fd: CInt, _ name: CInt
) -> Int {
#if ENABLE_MOCKING
if mockingEnabled { return _mockInt(fd, name) }
#endif
return fpathconf(fd, name)
}
Loading