Index: libcfa/src/fstream.cfa
===================================================================
--- libcfa/src/fstream.cfa	(revision 7ce24839a887c08f09257750744969c336756bc9)
+++ libcfa/src/fstream.cfa	(revision 8dcb8322993458ade50fa95feddca3d2de4d72b6)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Oct  1 08:10:21 2021
-// Update Count     : 473
+// Last Modified On : Wed Oct  6 18:39:13 2021
+// Update Count     : 508
 //
 
@@ -36,5 +36,4 @@
 	prt$ = false;
 	sawNL$ = false;
-	acquired$ = false;
 	sepSetCur$( os, sepGet( os ) );
 	sepSet( os, " " );
@@ -101,5 +100,4 @@
 	if ( &os == &exit ) exit( EXIT_FAILURE );
 	if ( &os == &abort ) abort();
-	if ( os.acquired$ ) { os.acquired$ = false; unlock( os ); }
 } // ends
 
@@ -109,5 +107,11 @@
 
 void open( ofstream & os, const char name[], const char mode[] ) {
-	FILE * file = fopen( name, mode );
+	FILE * file;
+    for ( cnt; 10 ) {
+		errno = 0;
+		file = fopen( name, mode );
+	  if ( file != 0p || errno != EINTR ) break;		// timer interrupt ?
+	  if ( cnt == 9 ) abort( "ofstream open EINTR spinning exceeded" );
+    } // for
 	if ( file == 0p ) {
 		throw (Open_Failure){ os };
@@ -123,5 +127,12 @@
   if ( (FILE *)(file$) == (FILE *)stdout || (FILE *)(file$) == (FILE *)stderr ) return;
 
-	if ( fclose( (FILE *)(file$) ) == EOF ) {
+	int ret;
+    for ( cnt; 10 ) {
+		errno = 0;
+		ret = fclose( (FILE *)(file$) );
+	  if ( ret != EOF || errno != EINTR ) break;		// timer interrupt ?
+	  if ( cnt == 9 ) abort( "ofstream open EINTR spinning exceeded" );
+    } // for
+	if ( ret == EOF ) {
 		throw (Close_Failure){ os };
 		// abort | IO_MSG "close output" | nl | strerror( errno );
@@ -146,5 +157,12 @@
 	va_list args;
 	va_start( args, format );
-	int len = vfprintf( (FILE *)(os.file$), format, args );
+		
+	int len;
+    for ( cnt; 10 ) {
+		errno = 0;
+		len = vfprintf( (FILE *)(os.file$), format, args );
+	  if ( len != EOF || errno != EINTR ) break;		// timer interrupt ?
+	  if ( cnt == 9 ) abort( "ofstream fmt EINTR spinning exceeded" );
+    } // for
 	if ( len == EOF ) {
 		if ( ferror( (FILE *)(os.file$) ) ) {
@@ -158,13 +176,4 @@
 	return len;
 } // fmt
-
-void acquire( ofstream & os ) with( os ) {
-	lock( os );											// may increase recursive lock
-	if ( ! acquired$ ) acquired$ = true;				// not locked ?
-	else unlock( os );									// unwind recursive lock at start
-} // acquire
-
-void ?{}( osacquire & acq, ofstream & os ) { &acq.os = &os; lock( os ); }
-void ^?{}( osacquire & acq ) { unlock( acq.os ); }
 
 static ofstream soutFile = { (FILE *)stdout };
@@ -195,5 +204,4 @@
 	file$ = file;
 	nlOnOff$ = false;
-	acquired$ = false;
 } // ?{}
 
@@ -215,5 +223,4 @@
 
 void ends( ifstream & is ) {
-	if ( is.acquired$ ) { is.acquired$ = false; unlock( is ); }
 } // ends
 
@@ -221,5 +228,11 @@
 
 void open( ifstream & is, const char name[], const char mode[] ) {
-	FILE * file = fopen( name, mode );
+	FILE * file;
+    for ( cnt; 10 ) {
+		errno = 0;
+		file = fopen( name, mode );
+	  if ( file != 0p || errno != EINTR ) break;		// timer interrupt ?
+	  if ( cnt == 9 ) abort( "ifstream open EINTR spinning exceeded" );
+    } // for
 	if ( file == 0p ) {
 		throw (Open_Failure){ is };
@@ -235,9 +248,16 @@
   if ( (FILE *)(file$) == (FILE *)stdin ) return;
 
-	if ( fclose( (FILE *)(file$) ) == EOF ) {
+	int ret;
+    for ( cnt; 10 ) {
+		errno = 0;
+		ret = fclose( (FILE *)(file$) );
+	  if ( ret != EOF || errno != EINTR ) break;		// timer interrupt ?
+	  if ( cnt == 9 ) abort( "ifstream close EINTR spinning exceeded" );
+    } // for
+	if ( ret == EOF ) {
 		throw (Close_Failure){ is };
 		// abort | IO_MSG "close input" | nl | strerror( errno );
 	} // if
-	file$ = 0p;
+	file$ = 0p;											// safety after close
 } // close
 
@@ -268,7 +288,12 @@
 int fmt( ifstream & is, const char format[], ... ) {
 	va_list args;
-
 	va_start( args, format );
-	int len = vfscanf( (FILE *)(is.file$), format, args );
+
+	int len;
+    for () {											// no check for EINTR limit waiting for keyboard input
+		errno = 0;
+		len = vfscanf( (FILE *)(is.file$), format, args );
+	  if ( len != EOF || errno != EINTR ) break;		// timer interrupt ?
+    } // for
 	if ( len == EOF ) {
 		if ( ferror( (FILE *)(is.file$) ) ) {
@@ -279,13 +304,4 @@
 	return len;
 } // fmt
-
-void acquire( ifstream & is ) with( is ) {
-	lock( is );											// may increase recursive lock
-	if ( ! acquired$ ) acquired$ = true;				// not locked ?
-	else unlock( is );									// unwind recursive lock at start
-} // acquire
-
-void ?{}( isacquire & acq, ifstream & is ) { &acq.is = &is; lock( is ); }
-void ^?{}( isacquire & acq ) { unlock( acq.is ); }
 
 static ifstream sinFile = { (FILE *)stdin };
