We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dcaadb commit 660193dCopy full SHA for 660193d
Foundation/NSData.swift
@@ -411,7 +411,11 @@ extension NSData {
411
while bytesRemaining > 0 {
412
var bytesWritten : Int
413
repeat {
414
- bytesWritten = Glibc.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
+ #if os(OSX) || os(iOS)
415
+ bytesWritten = Darwin.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
416
+ #elseif os(Linux)
417
+ bytesWritten = Glibc.write(fd, buf.advanced(by: length - bytesRemaining), bytesRemaining)
418
+ #endif
419
} while (bytesWritten < 0 && errno == EINTR)
420
if bytesWritten <= 0 {
421
throw _NSErrorWithErrno(errno, reading: false, path: path)
0 commit comments