@@ -70,7 +70,7 @@ extension FileDescriptor {
7070 _ mode: FileDescriptor . AccessMode ,
7171 options: FileDescriptor . OpenOptions ,
7272 permissions: FilePermissions ? ,
73- retryOnInterrupt: Bool = true
73+ retryOnInterrupt: Bool
7474 ) -> Result < FileDescriptor , Errno > {
7575 let oFlag = mode. rawValue | options. rawValue
7676 let descOrError : Result < CInt , Errno > = valueOrErrno ( retryOnInterrupt: retryOnInterrupt) {
@@ -96,7 +96,7 @@ extension FileDescriptor {
9696
9797 @usableFromInline
9898 internal func _close( ) -> Result < ( ) , Errno > {
99- nothingOrErrno ( system_close ( self . rawValue) )
99+ nothingOrErrno ( retryOnInterrupt : false ) { system_close ( self . rawValue) }
100100 }
101101
102102 /// Reposition the offset for the given file descriptor.
@@ -120,8 +120,9 @@ extension FileDescriptor {
120120 internal func _seek(
121121 offset: Int64 , from whence: FileDescriptor . SeekOrigin
122122 ) -> Result < Int64 , Errno > {
123- let newOffset = system_lseek ( self . rawValue, _COffT ( offset) , whence. rawValue)
124- return valueOrErrno ( Int64 ( newOffset) )
123+ valueOrErrno ( retryOnInterrupt: false ) {
124+ Int64 ( system_lseek ( self . rawValue, _COffT ( offset) , whence. rawValue) )
125+ }
125126 }
126127
127128
@@ -163,7 +164,7 @@ extension FileDescriptor {
163164 @usableFromInline
164165 internal func _read(
165166 into buffer: UnsafeMutableRawBufferPointer ,
166- retryOnInterrupt: Bool = true
167+ retryOnInterrupt: Bool
167168 ) throws -> Result < Int , Errno > {
168169 valueOrErrno ( retryOnInterrupt: retryOnInterrupt) {
169170 system_read ( self . rawValue, buffer. baseAddress, buffer. count)
0 commit comments