Index: libcfa/src/bits/debug.cfa
===================================================================
--- libcfa/src/bits/debug.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/bits/debug.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,9 +10,8 @@
 // Created On       : Thu Mar 30 12:30:01 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Feb  4 13:03:16 2020
-// Update Count     : 11
+// Last Modified On : Wed Jun 17 11:07:13 2020
+// Update Count     : 12
 //
 
-extern "C" {
 #include <stdio.h>
 #include <stdlib.h>
@@ -21,5 +20,4 @@
 #include <stdarg.h>
 #include <unistd.h>
-}
 
 enum { buffer_size = 4096 };
Index: libcfa/src/bits/signal.hfa
===================================================================
--- libcfa/src/bits/signal.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/bits/signal.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -19,5 +19,4 @@
 #include "bits/defs.hfa"
 
-extern "C" {
 #include <errno.h>
 #define __USE_GNU
@@ -26,5 +25,4 @@
 #include <stdlib.h>
 #include <string.h>
-}
 
 // Short hands for signal context information
Index: libcfa/src/concurrency/alarm.cfa
===================================================================
--- libcfa/src/concurrency/alarm.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/concurrency/alarm.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,17 +10,15 @@
 // Created On       : Fri Jun 2 11:31:25 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Jan  5 08:41:36 2020
-// Update Count     : 69
+// Last Modified On : Wed Jun 17 16:11:35 2020
+// Update Count     : 75
 //
 
 #define __cforall_thread__
 
-extern "C" {
 #include <errno.h>
 #include <stdio.h>
+#include <unistd.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/time.h>
-}
 
 #include "alarm.hfa"
@@ -55,5 +53,5 @@
 }
 
-void ?{}( alarm_node_t & this, processor   * proc, Time alarm, Duration period ) with( this ) {
+void ?{}( alarm_node_t & this, processor * proc, Time alarm, Duration period ) with( this ) {
 	this.proc = proc;
 	this.alarm = alarm;
Index: libcfa/src/concurrency/preemption.cfa
===================================================================
--- libcfa/src/concurrency/preemption.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/concurrency/preemption.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Mon Jun 5 14:20:42 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Dec  5 16:34:05 2019
-// Update Count     : 43
+// Last Modified On : Wed Jun 17 11:36:25 2020
+// Update Count     : 46
 //
 
@@ -19,5 +19,4 @@
 #include <assert.h>
 
-extern "C" {
 #include <errno.h>
 #include <stdio.h>
@@ -25,5 +24,4 @@
 #include <unistd.h>
 #include <limits.h>										// PTHREAD_STACK_MIN
-}
 
 #include "bits/signal.hfa"
Index: libcfa/src/containers/stackLockFree.hfa
===================================================================
--- libcfa/src/containers/stackLockFree.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/containers/stackLockFree.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -9,6 +9,6 @@
 // Created On       : Wed May 13 20:58:58 2020
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 13:30:08 2020
-// Update Count     : 55
+// Last Modified On : Sun Jun 14 13:25:09 2020
+// Update Count     : 64
 //
 
@@ -19,17 +19,17 @@
 forall( dtype T )
 union Link {
-	struct {									// 32/64-bit x 2
+	struct {											// 32/64-bit x 2
 		T * volatile top;								// pointer to stack top
-		uintptr_t count;						// count each push
+		uintptr_t count;								// count each push
 	};
 	#if __SIZEOF_INT128__ == 16
-	__int128									// gcc, 128-bit integer
+	__int128											// gcc, 128-bit integer
 	#else
-	uint64_t									// 64-bit integer
+	uint64_t											// 64-bit integer
 	#endif // __SIZEOF_INT128__ == 16
 	atom;
 }; // Link
 
-forall( otype T | { Link(T) * ?`next( T * ); } ) {
+forall( otype T | sized(T) | { Link(T) * ?`next( T * ); } ) {
 	struct StackLF {
 		Link(T) stack;
@@ -42,6 +42,6 @@
 
 		void push( StackLF(T) & this, T & n ) with(this) {
+			*( &n )`next = stack;					// atomic assignment unnecessary, or use CAA
 			for () {									// busy wait
-				*( &n )`next = stack;					// atomic assignment unnecessary, or use CAA
 			  if ( __atomic_compare_exchange_n( &stack.atom, &( &n )`next->atom, (Link(T))@{ {&n, ( &n )`next->count + 1} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) break; // attempt to update top node
 			} // for
@@ -49,7 +49,6 @@
 
 		T * pop( StackLF(T) & this ) with(this) {
-			Link(T) t @= {};
+			Link(T) t @= stack;							// atomic assignment unnecessary, or use CAA
 			for () {									// busy wait
-				t = stack;								// atomic assignment unnecessary, or use CAA
 			  if ( t.top == 0p ) return 0p;				// empty stack ?
 			  if ( __atomic_compare_exchange_n( &stack.atom, &t.atom, (Link(T))@{ {( t.top )`next->top, t.count} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) return t.top; // attempt to update top node
Index: libcfa/src/containers/vector.hfa
===================================================================
--- libcfa/src/containers/vector.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/containers/vector.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,13 +10,11 @@
 // Created On       : Tue Jul  5 18:00:07 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 22 10:01:18 2017
-// Update Count     : 3
+// Last Modified On : Wed Jun 17 11:02:46 2020
+// Update Count     : 4
 //
 
 #pragma once
 
-extern "C" {
 #include <stdbool.h>
-}
 
 //------------------------------------------------------------------------------
Index: libcfa/src/fstream.cfa
===================================================================
--- libcfa/src/fstream.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/fstream.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Feb  7 19:01:01 2020
-// Update Count     : 363
+// Last Modified On : Fri Jun 19 16:24:54 2020
+// Update Count     : 384
 //
 
@@ -26,5 +26,5 @@
 
 
-//*********************************** ofstream ***********************************
+// *********************************** ofstream ***********************************
 
 
@@ -123,5 +123,6 @@
 	#ifdef __CFA_DEBUG__
 	if ( file == 0p ) {
-		abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno );
+		throw (Open_Failure){ os };
+		// abort | IO_MSG "open output file \"" | name | "\"" | nl | strerror( errno );
 	} // if
 	#endif // __CFA_DEBUG__
@@ -134,9 +135,11 @@
 
 void close( ofstream & os ) {
-	if ( (FILE *)(os.$file) == stdout || (FILE *)(os.$file) == stderr ) return;
+  if ( (FILE *)(os.$file) == 0p ) return;
+  if ( (FILE *)(os.$file) == (FILE *)stdout || (FILE *)(os.$file) == (FILE *)stderr ) return;
 
 	if ( fclose( (FILE *)(os.$file) ) == EOF ) {
 		abort | IO_MSG "close output" | nl | strerror( errno );
 	} // if
+	os.$file = 0p;
 } // close
 
@@ -179,5 +182,5 @@
 
 
-//*********************************** ifstream ***********************************
+// *********************************** ifstream ***********************************
 
 
@@ -219,5 +222,6 @@
 	#ifdef __CFA_DEBUG__
 	if ( file == 0p ) {
-		abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno );
+		throw (Open_Failure){ is };
+		// abort | IO_MSG "open input file \"" | name | "\"" | nl | strerror( errno );
 	} // if
 	#endif // __CFA_DEBUG__
@@ -230,9 +234,11 @@
 
 void close( ifstream & is ) {
-	if ( (FILE *)(is.$file) == stdin ) return;
+  if ( (FILE *)(is.$file) == 0p ) return;
+  if ( (FILE *)(is.$file) == (FILE *)stdin ) return;
 
 	if ( fclose( (FILE *)(is.$file) ) == EOF ) {
 		abort | IO_MSG "close input" | nl | strerror( errno );
 	} // if
+	is.$file = 0p;
 } // close
 
@@ -276,4 +282,29 @@
 ifstream & sin = sinFile, & stdin = sinFile;
 
+
+// *********************************** exceptions ***********************************
+
+
+void ?{}( Open_Failure & this, ofstream & ostream ) {
+	VTABLE_INIT(this, Open_Failure);
+	this.ostream = &ostream;
+	this.tag = 1;
+}
+void ?{}( Open_Failure & this, ifstream & istream ) {
+	VTABLE_INIT(this, Open_Failure);
+	this.istream = &istream;
+	this.tag = 0;
+}
+const char * Open_Failure_msg(Open_Failure * this) {
+	return "Open_Failure";
+}
+VTABLE_INSTANCE(Open_Failure)(Open_Failure_msg);
+void throwOpen_Failure( ofstream & ostream ) {
+	Open_Failure exc = { ostream };
+}
+void throwOpen_Failure( ifstream & istream ) {
+	Open_Failure exc = { istream };
+}
+
 // Local Variables: //
 // tab-width: 4 //
Index: libcfa/src/fstream.hfa
===================================================================
--- libcfa/src/fstream.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/fstream.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Feb 17 08:29:23 2020
-// Update Count     : 175
+// Last Modified On : Fri Jun 19 16:29:17 2020
+// Update Count     : 189
 //
 
@@ -17,7 +17,8 @@
 
 #include "iostream.hfa"
+#include <exception.hfa>
 
 
-//*********************************** ofstream ***********************************
+// *********************************** ofstream ***********************************
 
 
@@ -78,5 +79,5 @@
 
 
-//*********************************** ifstream ***********************************
+// *********************************** ifstream ***********************************
 
 
@@ -106,4 +107,20 @@
 extern ifstream & sin, & stdin;							// aliases
 
+
+// *********************************** exceptions ***********************************
+
+
+DATA_EXCEPTION(Open_Failure)(
+	union {
+		ofstream * ostream;
+		ifstream * istream;
+	};
+	// TEMPORARY: need polymorphic exceptions
+	int tag;											// 1 => ostream; 0 => istream
+);
+
+void ?{}( Open_Failure & this, ofstream & ostream );
+void ?{}( Open_Failure & this, ifstream & istream );
+
 // Local Variables: //
 // mode: c //
Index: libcfa/src/heap.cfa
===================================================================
--- libcfa/src/heap.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/heap.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Tue Dec 19 21:58:35 2017
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed May 27 15:08:49 2020
-// Update Count     : 770
+// Last Modified On : Sat Jun 13 22:42:15 2020
+// Update Count     : 805
 //
 
@@ -208,7 +208,9 @@
 
 #if BUCKETLOCK == LOCKFREE
-static inline Link(HeapManager.Storage) * ?`next( HeapManager.Storage * this ) { return &this->header.kind.real.next; }
-static inline void ?{}( HeapManager.FreeHeader & ) {}
-static inline void ^?{}( HeapManager.FreeHeader & ) {}
+static inline {
+	Link(HeapManager.Storage) * ?`next( HeapManager.Storage * this ) { return &this->header.kind.real.next; }
+	void ?{}( HeapManager.FreeHeader & ) {}
+	void ^?{}( HeapManager.FreeHeader & ) {}
+} // distribution
 #endif // LOCKFREE
 
Index: libcfa/src/iostream.cfa
===================================================================
--- libcfa/src/iostream.cfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/iostream.cfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,22 +10,22 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sat May  2 18:30:25 2020
-// Update Count     : 1017
+// Last Modified On : Fri Jun 19 16:15:34 2020
+// Update Count     : 1019
 //
 
 #include "iostream.hfa"
 
-extern "C" {
 #include <stdio.h>
 #include <stdbool.h>									// true/false
 #include <stdint.h>										// UINT64_MAX
+#include <float.h>										// DBL_DIG, LDBL_DIG
+#include <math.h>										// isfinite
+#include <complex.h>									// creal, cimag
 //#include <string.h>									// strlen, strcmp
+extern "C" {
 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
 extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
-#include <float.h>										// DBL_DIG, LDBL_DIG
-#include <math.h>										// isfinite
-#include <complex.h>									// creal, cimag
 } // extern "C"
 
@@ -33,5 +33,5 @@
 
 
-//*********************************** ostream ***********************************
+// *********************************** ostream ***********************************
 
 
@@ -447,7 +447,7 @@
 } // distribution
 
-//*********************************** manipulators ***********************************
-
-//*********************************** integral ***********************************
+// *********************************** manipulators ***********************************
+
+// *********************************** integral ***********************************
 
 static const char * shortbin[] = { "0", "1", "10", "11", "100", "101", "110", "111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111" };
@@ -664,5 +664,5 @@
 #endif // __SIZEOF_INT128__
 
-//*********************************** floating point ***********************************
+// *********************************** floating point ***********************************
 
 #define PrintWithDP2( os, format, val, ... ) \
@@ -720,5 +720,5 @@
 FloatingPointFMTImpl( long double, "%    *L ", "%    *.*L " )
 
-//*********************************** character ***********************************
+// *********************************** character ***********************************
 
 forall( dtype ostype | ostream( ostype ) ) {
@@ -753,5 +753,5 @@
 } // distribution
 
-//*********************************** C string ***********************************
+// *********************************** C string ***********************************
 
 forall( dtype ostype | ostream( ostype ) ) {
@@ -800,5 +800,5 @@
 
 
-//*********************************** istream ***********************************
+// *********************************** istream ***********************************
 
 
@@ -946,5 +946,5 @@
 } // distribution
 
-//*********************************** manipulators ***********************************
+// *********************************** manipulators ***********************************
 
 forall( dtype istype | istream( istype ) )
Index: libcfa/src/iostream.hfa
===================================================================
--- libcfa/src/iostream.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/iostream.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Wed May 27 17:56:53 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 20 15:30:56 2020
-// Update Count     : 337
+// Last Modified On : Fri Jun 19 16:15:56 2020
+// Update Count     : 338
 //
 
@@ -19,5 +19,5 @@
 
 
-//*********************************** ostream ***********************************
+// *********************************** ostream ***********************************
 
 
@@ -156,5 +156,5 @@
 } // distribution
 
-//*********************************** manipulators ***********************************
+// *********************************** manipulators ***********************************
 
 forall( otype T )
@@ -175,5 +175,5 @@
 }; // _Ostream_Manip
 
-//*********************************** integral ***********************************
+// *********************************** integral ***********************************
 
 // See 6.7.9. 19) The initialization shall occur in initializer list order, each initializer provided for a particular
@@ -217,5 +217,5 @@
 #endif
 
-//*********************************** floating point ***********************************
+// *********************************** floating point ***********************************
 
 // Default suffix for values with no fraction is "."
@@ -246,5 +246,5 @@
 FloatingPointFMTDecl( long double )
 
-//*********************************** character ***********************************
+// *********************************** character ***********************************
 
 static inline {
@@ -263,5 +263,5 @@
 } // ?|?
 
-//*********************************** C string ***********************************
+// *********************************** C string ***********************************
 
 static inline {
@@ -282,5 +282,5 @@
 
 
-//*********************************** istream ***********************************
+// *********************************** istream ***********************************
 
 
@@ -336,5 +336,5 @@
 } // distribution
 
-//*********************************** manipulators ***********************************
+// *********************************** manipulators ***********************************
 
 struct _Istream_Cstr {
@@ -413,5 +413,5 @@
 
 
-//*********************************** time ***********************************
+// *********************************** time ***********************************
 
 
Index: libcfa/src/stdhdr/sys/time.h
===================================================================
--- libcfa/src/stdhdr/sys/time.h	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
+++ libcfa/src/stdhdr/sys/time.h	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -0,0 +1,24 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+// 
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// time.h -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Tue Jun 16 22:19:03 2020
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Tue Jun 16 22:19:56 2020
+// Update Count     : 1
+// 
+
+extern "C" {
+#include_next <sys/time.h>								// has internal check for multiple expansion
+} // extern "C"
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: libcfa/src/time.hfa
===================================================================
--- libcfa/src/time.hfa	(revision d72c0742cc731513cf36585129b8102b056de005)
+++ libcfa/src/time.hfa	(revision 8b58baeb5312bd49746f84b760dfbdcb2c8d577e)
@@ -10,6 +10,6 @@
 // Created On       : Wed Mar 14 23:18:57 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Feb  4 08:24:32 2020
-// Update Count     : 654
+// Last Modified On : Wed Jun 17 16:13:00 2020
+// Update Count     : 663
 //
 
@@ -20,7 +20,5 @@
 
 #include <time.h>										// timespec
-extern "C" {
 #include <sys/time.h>									// timeval
-}
 #include <time_t.hfa>									// Duration/Time types
 
@@ -91,4 +89,13 @@
 	int64_t ?`w( Duration dur ) { return dur.tn / (7LL * 24LL * 60LL * 60LL * TIMEGRAN); }
 
+	double ?`dns( Duration dur ) { return dur.tn; }
+	double ?`dus( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000_000.); }
+	double ?`dms( Duration dur ) { return dur.tn / ((double)TIMEGRAN / 1_000.); }
+	double ?`ds( Duration dur ) { return dur.tn / (double)TIMEGRAN; }
+	double ?`dm( Duration dur ) { return dur.tn / (60. * TIMEGRAN); }
+	double ?`dh( Duration dur ) { return dur.tn / (60. * 60. * (double)TIMEGRAN); }
+	double ?`dd( Duration dur ) { return dur.tn / (24. * 60. * 60. * (double)TIMEGRAN); }
+	double ?`dw( Duration dur ) { return dur.tn / (7. * 24. * 60. * 60. * (double)TIMEGRAN); }
+
 	Duration max( Duration lhs, Duration rhs ) { return  (lhs.tn < rhs.tn) ? rhs : lhs;}
 	Duration min( Duration lhs, Duration rhs ) { return !(rhs.tn < lhs.tn) ? lhs : rhs;}
