Errno.swift 332 B

1234567891011121314151617181920
  1. //
  2. // Errno.swift
  3. // Swifter
  4. //
  5. // Copyright © 2016 Damian Kołakowski. All rights reserved.
  6. //
  7. #if os(Linux)
  8. import Glibc
  9. #else
  10. import Foundation
  11. #endif
  12. public struct Errno {
  13. public static var description: String {
  14. return String(cString: UnsafePointer(strerror(errno))) ?? "Error: \(errno)"
  15. }
  16. }