OpenVMSOperatingSystem.st
changeset 8266 3dc78835e119
parent 7080 a82683bc1843
child 8901 824a89d0b5c7
--- a/OpenVMSOperatingSystem.st	Sat Mar 20 20:22:20 2004 +0100
+++ b/OpenVMSOperatingSystem.st	Sat Mar 20 20:23:29 2004 +0100
@@ -111,7 +111,7 @@
 /* ST/X maintained per-process information */
 
 struct procInfo {
-    long  returnStatus; 
+    long  returnStatus;
     long  pid;
     char  eventFlag;
     char  finished;
@@ -134,7 +134,7 @@
  * already block against multiple inclusion, some
  * do not. Therefore, this is done here again.
  * (it does not hurt)
- */ 
+ */
 
 #ifdef WANT_SHM
 extern int shmctl(), shmget(), shmdt();
@@ -257,8 +257,8 @@
 # endif
 #endif
 
-/* 
- * posix systems should define these ... 
+/*
+ * posix systems should define these ...
  * but on some (older) systems, they are not.
  */
 #ifndef S_IXUSR
@@ -337,7 +337,7 @@
  * some (old ?) systems do not define this ...
  */
 #if !defined(R_OK) && !defined(_AIX)
-# define R_OK    4       /* Test for Read permission */ 
+# define R_OK    4       /* Test for Read permission */
 # define W_OK    2       /* Test for Write permission */
 # define X_OK    1       /* Test for eXecute permission */
 # define F_OK    0       /* Test for existence of File */
@@ -429,7 +429,7 @@
 		do {
 		    ret = stat(t, buffP);
 		} while ((ret < 0) && (errno == EINTR));
-		if (ret >= 0) 
+		if (ret >= 0)
 		    return ret;
 	    }
 
@@ -471,7 +471,7 @@
 /*
  * same for access
  */
-int 
+int
 __vms_access__(path, mode)
     char *path;
     int mode;
@@ -515,7 +515,7 @@
 /* #define PROCESSDEBUG /* */
 
 void
-__vms_ASTChildWithInfo(pInfo) 
+__vms_ASTChildWithInfo(pInfo)
     struct procInfo *pInfo;
 {
 #ifdef WAITDEBUG
@@ -605,7 +605,7 @@
 "
     this class realizes access to most (all ?) required operating system services;
     some of it is very specific for unix, so do not depend on
-    things available here in your applications 
+    things available here in your applications
     - some may not be found in other OS's or be slightly different ...
 
     (On the other hand: I do not want to hide all features
@@ -639,7 +639,7 @@
 "
   various queries
 								[exBegin]
-    Transcript 
+    Transcript
 	showCR:'hello ' , (OperatingSystem getLoginName)
 								[exEnd]
 
@@ -652,19 +652,19 @@
 								[exEnd]
 
 								[exBegin]
-    Transcript 
+    Transcript
 	showCR:'this machine is called ' , OperatingSystem getHostName
 								[exEnd]
 
 								[exBegin]
-    Transcript 
+    Transcript
 	showCR:('this machine is in the '
 	       , OperatingSystem getDomainName
 	       , ' domain')
 								[exEnd]
 
 								[exBegin]
-    Transcript 
+    Transcript
 	showCR:('this machine''s CPU is a '
 	       , OperatingSystem getCPUType
 	       )
@@ -676,7 +676,7 @@
     Transcript showCR:'... done.'.
 								[exEnd]
 
-  locking a file 
+  locking a file
   (should be executed on two running smalltalks - not in two threads):
 								[exBegin]
     |f|
@@ -686,7 +686,7 @@
     10 timesRepeat:[
 	'about to lock ...' printCR.
 	[
-	  OperatingSystem 
+	  OperatingSystem
 	    lockFD:(f fileDescriptor)
 	    shared:false
 	    blocking:false
@@ -697,7 +697,7 @@
 	'LOCKED ...' printCR.
 	Delay waitForSeconds:10.
 	'unlock ...' printCR.
-	(OperatingSystem 
+	(OperatingSystem
 	    unlockFD:(f fileDescriptor)) printCR.
 	Delay waitForSeconds:3.
     ]
@@ -1818,8 +1818,8 @@
 !
 
 errorSymbolAndTextForNumber:errNr
-    "return an array consisting of symbol &  message string from a unix errorNumber 
-     (as returned by a system call). 
+    "return an array consisting of symbol &  message string from a unix errorNumber
+     (as returned by a system call).
      The returned message is in english (as found in /usr/include/errno.h)
      and should be replaced by a resource lookup before being presented to the user."
 
@@ -2485,7 +2485,7 @@
 	    out_mbxdsc.dsc$a_pointer = out_mbxname.body;
 	}
 
-	/* 
+	/*
 	 * Build descriptor for command line
 	 */
 	cmddsc.dsc$w_length  = strlen(fullCmdLine);
@@ -2507,7 +2507,7 @@
 
 	if (doFork == true) {
 # ifdef NOTDEF
-	    /* 
+	    /*
 	     * Allocate an event flag to signal process termination
 	     */
 	    status = LIB$GET_EF(&siop->event_flag);
@@ -2550,7 +2550,7 @@
 			       &flags,
 			       0,               /* process name */
 			       &(pInfo->pid),
-			       &(pInfo->returnStatus), 
+			       &(pInfo->returnStatus),
 			       &procEventFlag,
 			       __vms_ASTChildWithInfo,
 			       pInfo,           /* AST argument */
@@ -2635,14 +2635,14 @@
 
     sema := Semaphore new name:'OS command wait'.
 
-    pid := Processor 
+    pid := Processor
 		monitor:[
-		    self 
+		    self
 			startProcess:aCommandString
-			inputFrom:anExternalInStream 
-			outputTo:anExternalOutStream 
+			inputFrom:anExternalInStream
+			outputTo:anExternalOutStream
 			errorTo:anExternalErrStream.
-		] 
+		]
 		action:[:status |
 		    status stillAlive ifFalse:[
 			exitStatus := status.
@@ -2678,8 +2678,8 @@
 
     sema := Semaphore new name:'OS command wait'.
 
-    pid := Processor 
-		monitor:[self startProcess:aCommandString] 
+    pid := Processor
+		monitor:[self startProcess:aCommandString]
 		action:[:status |
 			status stillAlive ifFalse:[
 			    exitStatus := status.
@@ -2699,11 +2699,11 @@
     ^ true.
 
     "
-     OperatingSystem executeCommand:'sleep 30' onError:[]. 
-     OperatingSystem executeCommand:'pwd' onError:[:status|status inspect]. 
-     OperatingSystem executeCommand:'ls -l' onError:[]. 
-     OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect]. 
-     OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect]. 
+     OperatingSystem executeCommand:'sleep 30' onError:[].
+     OperatingSystem executeCommand:'pwd' onError:[:status|status inspect].
+     OperatingSystem executeCommand:'ls -l' onError:[].
+     OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect].
+     OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect].
     "
 
     "Created: 22.12.1995 / 14:49:59 / stefan"
@@ -2745,11 +2745,11 @@
     ^ true.
 
     "
-     OperatingSystem executeCommand:'sleep 30' onError:[]. 
-     OperatingSystem executeCommand:'pwd' onError:[:status|status inspect]. 
-     OperatingSystem executeCommand:'ls -l' onError:[]. 
-     OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect]. 
-     OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect]. 
+     OperatingSystem executeCommand:'sleep 30' onError:[].
+     OperatingSystem executeCommand:'pwd' onError:[:status|status inspect].
+     OperatingSystem executeCommand:'ls -l' onError:[].
+     OperatingSystem executeCommand:'invalidCommand' onError:[:status| status inspect].
+     OperatingSystem executeCommand:'rm /tmp/foofoofoofoo'onError:[:status | status inspect].
     "
 
     "Created: 28.1.1998 / 14:12:15 / md"
@@ -2758,7 +2758,7 @@
 fork
     "fork a new (HEAVY-weight) unix process.
      Not supported with MSDOS & VMS systems.
-     Dont confuse this with Block>>fork, which creates 
+     Dont confuse this with Block>>fork, which creates
      lightweight smalltalk processes. This method will return
      0 to the child process, and a non-zero number (which is the childs
      unix-process-id) to the parent (original) process.
@@ -2919,7 +2919,7 @@
      sema := Semaphore new.
      pid := OperatingSystem startProcess:'sleep 10; grep drw' inputFrom:in outputTo:out errorTo:err.
 
-     The following will no longer work. monitorPid has disappeared 
+     The following will no longer work. monitorPid has disappeared
 
      pid notNil ifTrue:[
 	 Processor monitorPid:pid action:[:OSstatus | sema signal ].
@@ -2982,7 +2982,7 @@
     self primitiveFailed
 
     "
-     OperatingSystem createDirectory:'foo'  
+     OperatingSystem createDirectory:'foo'
     "
 
     "Modified: 20.12.1995 / 11:24:13 / stefan"
@@ -2997,7 +2997,7 @@
 	"/
 	"/ bad argument(s) given
 	"/
-	^ self primitiveFailed 
+	^ self primitiveFailed
     ].
 
     "/
@@ -3036,7 +3036,7 @@
 !
 
 removeDirectory:fullPathName
-    "remove the directory named 'fullPathName'. 
+    "remove the directory named 'fullPathName'.
      The directory must be empty and you must have appropriate access rights.
      Return true if successful, false if directory is not empty or no permission.
      This is a lowLevel entry - use Filename protocol for compatibility."
@@ -3099,8 +3099,8 @@
 !
 
 renameFile:oldPath to:newPath
-    "rename the file 'oldPath' to 'newPath'. 
-     Someone else has to care for the names to be correct and 
+    "rename the file 'oldPath' to 'newPath'.
+     Someone else has to care for the names to be correct and
      correct for the OS used - therefore, this should not be called
      directlt. Instead, use Filename protocol to rename; this cares for
      any invalid names.
@@ -3170,13 +3170,13 @@
 	    @global(LastErrorNumber) = __MKSMALLINT(errno);
 	    RETURN ( false );
 	}
-        
+
 	ret = ftruncate(fd, __intVal(newSize));
 	close(fd);
 	if (ret < 0) {
 	    @global(LastErrorNumber) = __MKSMALLINT(errno);
 	    RETURN ( false );
-	} 
+	}
 	RETURN (true);
     }
 # endif /* using FTRUNCATE */
@@ -3188,7 +3188,7 @@
 !OpenVMSOperatingSystem class methodsFor:'file access rights'!
 
 accessMaskFor:aSymbol
-    "return the access bits mask for numbers as returned by 
+    "return the access bits mask for numbers as returned by
      OperatingSystem>>accessModeOf:
      and expected by OperatingSystem>>changeAccessModeOf:to:.
      Since these numbers are OS dependent, always use the mask
@@ -3247,7 +3247,7 @@
 accessModeOf:aPathName
     "return a number representing access rights rwxrwxrwx for owner,
      group and others. Return nil if such a file does not exist.
-     Notice that the returned number is OS dependent - use the 
+     Notice that the returned number is OS dependent - use the
      modeMasks as returned by OperatingSystem>>accessMaskFor:"
 
     "
@@ -3287,7 +3287,7 @@
 changeAccessModeOf:aPathName to:modeBits
     "change the access rights of aPathName to the OS dependent modeBits.
      You should construct this mask using accessMaskFor, to be OS
-     independent. Return true if changed, 
+     independent. Return true if changed,
      false if such a file does not exist or change was not allowd."
 
 %{
@@ -3316,15 +3316,15 @@
     (such as returned by ExternalStream>>fileDescriptor).
     On some systems, only advisory locks are available -
     these depends on other accessors to also perform the locking operation.
-    If they do not, they may still access the file 
-    (on some systems, locks are mandatory, on others, they are advisory). 
+    If they do not, they may still access the file
+    (on some systems, locks are mandatory, on others, they are advisory).
     The isSharedReadLock argument (if true) specifies if multiple readers
     are to be allowed - if false, they are not.
     On some systems, all locks are non-exclusive locks.
 
     Returns true, if the lock was aquired, false otherwise.
 
-    Notice, that not all OS's support these locks; 
+    Notice, that not all OS's support these locks;
     on some, this may simply be a no-op.
     Also notice, that some systems block the process, to wait for the lock.
     This can (again: on some systems) be avoided by passing a false blockIfLocked
@@ -3336,11 +3336,11 @@
 	int lockArg;
 
 	/*
-	 * claus: sigh - each one has a different interface ... 
+	 * claus: sigh - each one has a different interface ...
 	 */
 #if defined(F_SETLK)
 	{
-	    /* 
+	    /*
 	     * new fcntl(SETLK) interface;
 	     * available on SYSV4 and Linux
 	     */
@@ -3368,7 +3368,7 @@
 #else /* no F_SETLK available */
 
 # if defined(LOCK_EX) && defined(LOCK_UN)
-	/* 
+	/*
 	 * BSD 4.3 advisory locks
 	 */
 	lockArg = LOCK_EX;
@@ -3389,7 +3389,7 @@
 # else /* no flock available */
 
 #  if defined(F_LOCK) && defined(F_UNLOCK)
-	/* 
+	/*
 	 * SYSV3 advisory locks
 	 */
 	if (lockf(fd, F_LOCK, 0) != -1) {
@@ -3483,12 +3483,12 @@
 unlockFD:aFileDescriptor
     "clear a file lock on the file represented by aFileDescriptor,
      which was previously aquired by #lockFD:.
-     Return false, if the unlock failed 
-     (which may happens when a wrong fd is passed, 
+     Return false, if the unlock failed
+     (which may happens when a wrong fd is passed,
       no lock was set previously, or the systsem does not support locks).
-     Notice, that not all OS's support file locks; 
+     Notice, that not all OS's support file locks;
      on some, this may simply be a no-op."
-     
+
 %{
     if (__isSmallInteger(aFileDescriptor)) {
 	int fd = __intVal(aFileDescriptor);
@@ -3526,7 +3526,7 @@
 # else /* no flock available */
 
 #  if defined(F_LOCK) && defined(F_UNLOCK)
-	/* 
+	/*
 	 * SYSV3 advisory locks
 	 */
 	if (lockf(fd, F_UNLOCK, 0) != -1) {
@@ -3544,7 +3544,7 @@
 
 caseSensitiveFilenames
     "return true, if the OS has caseSensitive file naming.
-     On MSDOS, this will return false; 
+     On MSDOS, this will return false;
      on a real OS, we return true."
 
     ^ false
@@ -3558,7 +3558,7 @@
 
     |names n "{ Class: SmallInteger }" |
 
-    names := pathName 
+    names := pathName
 		asCollectionOfSubstringsSeparatedBy:self fileSeparator.
     names := names asOrderedCollection.
     "
@@ -3585,25 +3585,25 @@
     "
      cut off parent-dirs at end
     "
-    [(n > 2) 
+    [(n > 2)
      and:[(names endsWith:#('..'))
      and:[((names at:(n - 1)) startsWith:'.') not ]]] whileTrue:[
 	names removeLast; removeLast.
 	n := n - 2.
     ].
 
-    ^ names asStringWith:self fileSeparator 
+    ^ names asStringWith:self fileSeparator
 		    from:1
 		    to:n
-		    compressTabs:false final:nil 
-
-    "
-     OperatingSystem compressPath:'./..'    
-     OperatingSystem compressPath:'/foo/bar/baz/..'  
-     OperatingSystem compressPath:'foo/bar/baz/..'  
-     OperatingSystem compressPath:'foo/bar/baz/../'  
-     OperatingSystem compressPath:'foo/bar/baz/..///' 
-     OperatingSystem compressPath:'///foo/bar/baz/..///' 
+		    compressTabs:false final:nil
+
+    "
+     OperatingSystem compressPath:'./..'
+     OperatingSystem compressPath:'/foo/bar/baz/..'
+     OperatingSystem compressPath:'foo/bar/baz/..'
+     OperatingSystem compressPath:'foo/bar/baz/../'
+     OperatingSystem compressPath:'foo/bar/baz/..///'
+     OperatingSystem compressPath:'///foo/bar/baz/..///'
     "
 
     "Modified: 1.11.1996 / 20:13:48 / cg"
@@ -3619,9 +3619,9 @@
 !
 
 getDriveList
-    "return a list of volumes in the system. 
-     On unix, no such thing like a volume exists 
-     - there, a syntetic list with root, home & current is returned. 
+    "return a list of volumes in the system.
+     On unix, no such thing like a volume exists
+     - there, a syntetic list with root, home & current is returned.
      On MSDOS, a list of drive letters is (eventually) returned.
      On VMS, a list of volumes is (eventually) returned."
 
@@ -3640,7 +3640,7 @@
     "/ default: retrurn array filled with
     "/ root, home and current directories.
     "/
-    ^ Array 
+    ^ Array
 	with:'/'
 	with:(self getHomeDirectory)
 	with:(Filename currentDirectory pathName)
@@ -3651,7 +3651,7 @@
      the info (for which corresponding access methods are understood by
      the returned object) is:
 	 type            - a symbol giving the files type
-	 mode            - numeric access mode 
+	 mode            - numeric access mode
 	 uid             - owners user id
 	 gid             - owners group id
 	 size            - files size
@@ -3668,19 +3668,19 @@
 
      Some of the fields may be returned as nil on systems which do not provide
      all of the information.
-     Return nil if such a file does not exist. 
-     For symbolic links (if supported by the OS), 
+     Return nil if such a file does not exist.
+     For symbolic links (if supported by the OS),
      the info of the pointed-to-file (i.e. the target) is returned;
      use #linkInfoOf: to get info about the link itself.
     "
 
-    |info type mode uid gid size id 
-     atime mtime ctime 
+    |info type mode uid gid size id
+     atime mtime ctime
      aOStime mOStime cOStime
      aYr aMon aDay aHr aMin aSec aMS
      mYr mMon mDay mHr mMin mSec mMS
      cYr cMon cDay cHr cMin cSec cMS
-     name2 
+     name2
      recordFormat recordAttribs fixedHeaderSize recordSize
      recordFormatNumeric|
 
@@ -3825,24 +3825,24 @@
 %}.
     mode notNil ifTrue:[
 	aOStime notNil ifTrue:[
-	    atime := AbsoluteTime fromOSTime:(aOStime * 1000).
-	    mtime := AbsoluteTime fromOSTime:(mOStime * 1000).
-	    ctime := AbsoluteTime fromOSTime:(cOStime * 1000).
+	    atime := Timestamp fromOSTime:(aOStime * 1000).
+	    mtime := Timestamp fromOSTime:(mOStime * 1000).
+	    ctime := Timestamp fromOSTime:(cOStime * 1000).
 	] ifFalse:[
-	    atime := AbsoluteTime day:aDay month:aMon year:aYr hour:aHr minutes:aMin seconds:aSec milliseconds:aMS.
-	    mtime := AbsoluteTime day:mDay month:mMon year:mYr hour:mHr minutes:mMin seconds:mSec milliseconds:mMS.
-	    ctime := AbsoluteTime day:cDay month:cMon year:cYr hour:cHr minutes:cMin seconds:cSec milliseconds:cMS.
+	    atime := Timestamp day:aDay month:aMon year:aYr hour:aHr minutes:aMin seconds:aSec milliseconds:aMS.
+	    mtime := Timestamp day:mDay month:mMon year:mYr hour:mHr minutes:mMin seconds:mSec milliseconds:mMS.
+	    ctime := Timestamp day:cDay month:cMon year:cYr hour:cHr minutes:cMin seconds:cSec milliseconds:cMS.
 	].
 
 	info := FileStatusInfo
-		    type:type 
-		    mode:mode 
-		    uid:uid 
-		    gid:gid 
-		    size:size 
-		    id:id 
-		    accessed:atime 
-		    modified:mtime 
+		    type:type
+		    mode:mode
+		    uid:uid
+		    gid:gid
+		    size:size
+		    id:id
+		    accessed:atime
+		    modified:mtime
 		    statusChanged:ctime
 		    path:nil.
 
@@ -3957,7 +3957,7 @@
 
     "
      OperatingSystem isSymbolicLink:'Make.proto'
-     OperatingSystem isSymbolicLink:'Makefile' 
+     OperatingSystem isSymbolicLink:'Makefile'
     "
 !
 
@@ -4015,14 +4015,14 @@
 
 linkInfoOf:aPathName
     "return a dictionary filled with info for the file 'aPathName',
-     IFF aPathName is a symbolic link. 
+     IFF aPathName is a symbolic link.
      If aPathName is invalid, or its NOT a symbolic link, nil is returned.
      (which means, that systems like VMS or MSDOS always return nil here.)
 
      The contents of the dictionary gives info about the link itself,
      on contrast to #infoOf:, which returns the info of the pointed to file
      in case of a symbolic link."
-     
+
     ^ nil
 !
 
@@ -4075,8 +4075,8 @@
      OperatingSystem pathNameOf:'../smalltalk/../smalltalk'
      OperatingSystem pathNameOf:'../../..'
      OperatingSystem pathNameOf:'..'
-     OperatingSystem pathNameOf:'/tmp////' 
-     OperatingSystem pathNameOf:'/foo/bar' 
+     OperatingSystem pathNameOf:'/tmp////'
+     OperatingSystem pathNameOf:'/foo/bar'
      OperatingSystem pathNameOf:'/foo/bar/'
      OperatingSystem pathNameOf:'/foo/bar//'
     "
@@ -4148,7 +4148,7 @@
     if (__isString(pathName)) {
 
 #ifdef HAS_GETCWD
-	if (strcmp(__stringVal(pathName), "[]") == 0) 
+	if (strcmp(__stringVal(pathName), "[]") == 0)
 	{
 	    char nameBuffer[MAXPATHLEN + 1];
 
@@ -4183,7 +4183,7 @@
      For nonexistent files, nil is returned."
 
     "could be implemented as:
-	(self infoOf:aPathName) accessed 
+	(self infoOf:aPathName) accessed
     "
 
     |osSeconds i|
@@ -4210,7 +4210,7 @@
     }
 #endif
 %}.
-    osSeconds notNil ifTrue:[^ AbsoluteTime fromOSTime:(osSeconds * 1000)].
+    osSeconds notNil ifTrue:[^ Timestamp fromOSTime:(osSeconds * 1000)].
 
     i := self infoOf:aPathName.
     i notNil ifTrue:[^ i accessed].
@@ -4222,7 +4222,7 @@
 !
 
 timeOfLastChange:aPathName
-    "return the time, when the file was last changed. 
+    "return the time, when the file was last changed.
      For nonexistent files, nil is returned."
 
     "could be implemented as:
@@ -4253,7 +4253,7 @@
     }
 #endif
 %}.
-    osSeconds notNil ifTrue:[^ AbsoluteTime fromOSTime:(osSeconds * 1000)].
+    osSeconds notNil ifTrue:[^ Timestamp fromOSTime:(osSeconds * 1000)].
 
     i := self infoOf:aPathName.
     i notNil ifTrue:[^ i modified].
@@ -4273,7 +4273,7 @@
 
     "
      this could have been implemented as:
-	(self infoOf:aPathName) type 
+	(self infoOf:aPathName) type
      but for huge directory searches the code below is faster
     "
 
@@ -4329,10 +4329,10 @@
     ^ nil.
 
     "
-     OperatingSystem typeOf:'/'   
-     OperatingSystem typeOf:'.'   
-     OperatingSystem typeOf:'Make.proto' 
-     OperatingSystem typeOf:'resources/motif.style' 
+     OperatingSystem typeOf:'/'
+     OperatingSystem typeOf:'.'
+     OperatingSystem typeOf:'Make.proto'
+     OperatingSystem typeOf:'resources/motif.style'
     "
 !
 
@@ -4463,7 +4463,7 @@
 
 disableTimer
     "disable timer interrupts.
-     WARNING: 
+     WARNING:
 	the system will not operate correctly with timer interrupts
 	disabled, because no scheduling or timeouts are possible."
 
@@ -4500,9 +4500,9 @@
 !
 
 enableChildSignalInterrupts
-    "enable childSignal interrupts 
+    "enable childSignal interrupts
      (SIGCHLD, if the architecture supports it).
-     After enabling, these signals will send the message 
+     After enabling, these signals will send the message
      'childSignalInterrupt' to the ChildSignalInterruptHandler object."
 
 %{
@@ -4899,7 +4899,7 @@
 	dt.it_interval.tv_sec = 0;
 	dt.it_interval.tv_usec = 0;
 	dt.it_value.tv_sec = millis / 1000;
-	dt.it_value.tv_usec = (millis % 1000) * 1000;  
+	dt.it_value.tv_usec = (millis % 1000) * 1000;
 	setitimer(ITIMER_REAL, &dt, 0);
 	RETURN (true);
     }
@@ -4977,7 +4977,7 @@
      Should be changed to use real profiling timer if available.
      On systems, where no virtual timer is available, use the real timer
      (which is of course less correct).
-     OBSOLETE: the new messageTally runs as a high prio process, not using 
+     OBSOLETE: the new messageTally runs as a high prio process, not using
 	       spy interrupts."
 
 %{  /* NOCONTEXT */
@@ -5016,7 +5016,7 @@
 
 stopSpyTimer
     "stop spy timing - disable spy timer.
-     OBSOLETE: the new messageTally runs as a high prio process, not using 
+     OBSOLETE: the new messageTally runs as a high prio process, not using
 	       spy interrupts."
 
 %{  /* NOCONTEXT */
@@ -5169,7 +5169,7 @@
     ].
     out := self createMailBox.
     out isNil ifTrue:[
-	self destroyMailBox:in. 
+	self destroyMailBox:in.
 	^ nil
     ].
     ^ Array with:in with:out
@@ -5318,7 +5318,7 @@
 	    idx ~~ 0 ifTrue:[
 		name := hostName copyFrom:idx+1.
 	    ]
-	]. 
+	].
 	name isNil ifTrue:[
 	    'OpenVMSOperatingSystem [warning]: cannot find out domainname' errorPrintCR.
 	    name := 'unknown'.
@@ -5392,7 +5392,7 @@
 #  if defined(HAS_SYSINFO) && defined(SI_HOSTNAME)
     char buffer[256];
     int ret;
- 
+
     if ((ret = sysinfo(SI_HOSTNAME, buffer, sizeof(buffer))) >= 0 && ret <= sizeof(buffer)) {
 	name = __MKSTRING(buffer);
     }
@@ -5461,9 +5461,9 @@
 	negativeSignSeparatedBySpaceFromCurrencySymbol  <Boolean>
 
 	positiveSignPosition                            <Symbol>
-							one of: #parenthesesAround, 
-								#signPrecedes, 
-								#signSuceeds, 
+							one of: #parenthesesAround,
+								#signPrecedes,
+								#signSuceeds,
 								#signPrecedesCurrencySymbol,
 								#signSuceedsCurrencySymbol
 
@@ -5520,10 +5520,10 @@
 	negativeSign = conf->negative_sign;
 	intFractDigits = conf->int_frac_digits;
 	fractDigits = conf->frac_digits;
-	csPosPrecedes = conf->p_cs_precedes; 
-	csNegPrecedes = conf->n_cs_precedes; 
-	csPosSepBySpace = conf->p_sep_by_space; 
-	csNegSepBySpace = conf->n_sep_by_space; 
+	csPosPrecedes = conf->p_cs_precedes;
+	csNegPrecedes = conf->n_cs_precedes;
+	csPosSepBySpace = conf->p_sep_by_space;
+	csNegSepBySpace = conf->n_sep_by_space;
 	csPosSignPosition = conf->p_sign_posn;
 	csNegSignPosition = conf->n_sign_posn;
     }
@@ -5538,10 +5538,10 @@
     negativeSign =(char *)0;
     intFractDigits = -1;
     fractDigits = -1;
-    csPosPrecedes = -1; 
-    csNegPrecedes = -1; 
-    csPosSepBySpace = -1; 
-    csNegSepBySpace = -1; 
+    csPosPrecedes = -1;
+    csNegPrecedes = -1;
+    csPosSepBySpace = -1;
+    csNegSepBySpace = -1;
     csPosSignPosition = -1;
     csNegSignPosition = -1;
 #endif
@@ -5737,20 +5737,20 @@
     "return info on the system weare running on.
      If the system supports the uname system call, that info is returned;
      otherwise, some simulated info is returned.
- 
+
      WARNING:
        Do not depend on the amount and contents of the returned information, some
        systems may return more/less than others. Also, the contents depends on the
        OS, for example, linux returns 'ix86', while WIN32 returns 'x86'.
 
        This method is mainly provided to augment error reports with some system
-       information. 
+       information.
        (in case of system/version specific OS errors, conditional workarounds and patches
 	may be based upon this info).
        Your application should NOT depend upon this in any way.
 
      The returned info may (or may not) contain:
-	#system -> some operating system identification (irix, Linux, nt, win32s ...) 
+	#system -> some operating system identification (irix, Linux, nt, win32s ...)
 	#version -> OS version (some os version identification)
 	#release -> OS release (3.5, 1.2.1 ...)
 	#node   -> some host identification (hostname)
@@ -5851,7 +5851,7 @@
 	 will be added in the future."
 
 %{  /* NOCONTEXT */
- 
+
     /*
      * TODO: newer systems provide a query function for this ... use it
      */
@@ -5872,7 +5872,7 @@
     RETURN ( __MKSMALLINT(MAXPATHLEN) );
 %}
     "
-     OperatingSystem maxPathLength   
+     OperatingSystem maxPathLength
     "
 !
 
@@ -5933,12 +5933,12 @@
     ^ true
 
     "
-     OperatingSystem supportsChildInterrupts 
+     OperatingSystem supportsChildInterrupts
     "
 !
 
 supportsIOInterrupts
-    "return true, if the OS supports IO availability interrupts 
+    "return true, if the OS supports IO availability interrupts
      (i.e. SIGPOLL/SIGIO).
 
      Currently, this mechanism does not work on all
@@ -5948,7 +5948,7 @@
     ^ false
 
     "
-     OperatingSystem supportsIOInterrupts 
+     OperatingSystem supportsIOInterrupts
     "
 !
 
@@ -5963,7 +5963,7 @@
     ^ false
 
     "
-     OperatingSystem supportsNonBlockingIO  
+     OperatingSystem supportsNonBlockingIO
     "
 !
 
@@ -5973,10 +5973,10 @@
      If false is returned, ProcessorScheduler will poll in 50ms
      intervals for I/O becoming ready."
 
-    ^ false "/ for now ... 
-
-    "
-     OperatingSystem supportsSelect 
+    ^ false "/ for now ...
+
+    "
+     OperatingSystem supportsSelect
     "
 !
 
@@ -6058,7 +6058,7 @@
 !
 
 computeOSTimeFromYear:y month:m day:d hour:h minute:min seconds:s millis:millis
-    "return the OS-dependent time for the given time and day. 
+    "return the OS-dependent time for the given time and day.
      The arguments are assumed to be in localtime including
      any daylight saving adjustings."
 
@@ -6068,7 +6068,7 @@
     struct tm tm;
     TIME_T t;
 
-    if (__bothSmallInteger(y, m) 
+    if (__bothSmallInteger(y, m)
      && __bothSmallInteger(d, h)
      && __bothSmallInteger(min, s)) {
 	tm.tm_hour = __intVal(h);
@@ -6086,7 +6086,7 @@
 %}.
     osSeconds notNil ifTrue:[
 	^ osSeconds * 1000 + millis
-    ].    
+    ].
     ^ self primitiveFailed
 
     "
@@ -6102,7 +6102,7 @@
      dayInYear (1..) and dayInWeek (1..).
      Conversion is to localtime including any daylight saving adjustments."
 
-    |low hi year month day hours minutes seconds millis utcOffset 
+    |low hi year month day hours minutes seconds millis utcOffset
      dst yDay wDay osSeconds ret|
 
     millis := osTime \\ 1000.
@@ -6161,7 +6161,7 @@
 !
 
 computeTimePartsOf:osTime for:aBlock
-    "compute hours, minutes, seconds and milliseconds from the osTime 
+    "compute hours, minutes, seconds and milliseconds from the osTime
      and evaluate the argument, a 4-arg block with these.
      Conversion is to localtime including any daylight saving adjustments."
 
@@ -6198,7 +6198,7 @@
      dayInYear (1..) and dayInWeek (1..).
      Conversion is to UTC."
 
-    |low hi year month day hours minutes seconds millis utcOffset 
+    |low hi year month day hours minutes seconds millis utcOffset
      dst yDay wDay osSeconds ret|
 
     millis := osTime \\ 1000.
@@ -6255,7 +6255,7 @@
 !
 
 computeUTCTimePartsOf:osTime for:aBlock
-    "compute hours, minutes, seconds and milliseconds from the osTime 
+    "compute hours, minutes, seconds and milliseconds from the osTime
      and evaluate the argument, a 4-arg block with these.
      Conversion is to UTC."
 
@@ -6284,10 +6284,10 @@
 !
 
 getMillisecondTime
-    "This returns the millisecond timers value. 
+    "This returns the millisecond timers value.
      The range is limited to 0..1fffffff (i.e. the SmallInteger range) to avoid
      LargeInteger arithmetic when doing timeouts and delays.
-     Since this value is wrapping around in regular intervals, this can only be used for 
+     Since this value is wrapping around in regular intervals, this can only be used for
      short relative time deltas.
      Use the millisecondTimeXXX:-methods to compare and add time deltas - these know about the wrap.
 
@@ -6314,7 +6314,7 @@
 
 # ifndef HAVE_TIME
 #  if defined(SYSV) && defined(HZ)
-    /* 
+    /*
      * sys5 time
      */
     long ticks;
@@ -6329,7 +6329,7 @@
 #endif
 
 #ifndef HAVE_TIME
-    /* assume HAS_GETTIMEOFDAY 
+    /* assume HAS_GETTIMEOFDAY
      * - will result in a linkage error
      * if not fixed.
      */
@@ -6354,12 +6354,12 @@
     "This returns the OS time.
      The base of the returned value is not consistent across
      different OS's - some return the number of millis since jan, 1st 1970;
-     others since 1900. The Time classes are prepared for this, and 
+     others since 1900. The Time classes are prepared for this, and
      converts as appropriate (by using my fromOSTime: conversion methods).
 
      Dont use this method in application code since it is an internal (private)
      interface. For compatibility with ST-80, use Time>>millisecondClockValue.
-     or use instances of Time, Date or AbsoluteTime to work with.
+     or use instances of Time, Date or Timestamp to work with.
     "
 
     |seconds millis|
@@ -6368,7 +6368,7 @@
 
     long t;
 
-#if !defined(HAS_GETTIMEOFDAY) 
+#if !defined(HAS_GETTIMEOFDAY)
 # if defined(HAS_FTIME)
     struct timeb timebuffer;
 
@@ -6380,7 +6380,7 @@
 
 # ifndef HAVE_TIME
 #  if defined(SYSV) && defined(HZ)
-    /* 
+    /*
      * sys5 time; we have to fake the information
      * the returned value is inexact.
      */
@@ -6411,7 +6411,7 @@
 #endif
 
 #ifndef HAVE_TIME
-    /* assume HAS_GETTIMEOFDAY 
+    /* assume HAS_GETTIMEOFDAY
      * - will result in a linkage error
      * if not fixed.
      */
@@ -6423,8 +6423,8 @@
 
     gettimeofday(&tb, &tzb);
 
-    /* 
-     * mhmh long-long stuff seems not to work correctly 
+    /*
+     * mhmh long-long stuff seems not to work correctly
      * on all machines (sparc)
      * being conservative here ...
      */
@@ -6478,9 +6478,9 @@
 millisecondDelay:millis
     "delay execution for millis milliseconds or until the next event
      arrives.
-     All lower priority threads will also sleep for the duration, 
+     All lower priority threads will also sleep for the duration,
      interrupts (and therefore, higher prio processes) are
-     still handled. 
+     still handled.
      Better use a Delay, to only delay the calling thread.
      (however, a delay cannot be used in the event handler or scheduler)"
 
@@ -6507,7 +6507,7 @@
 # endif
 #endif
 %}.
- 
+
     now := OpenVMSOperatingSystem getMillisecondTime.
     then := OpenVMSOperatingSystem millisecondTimeAdd:now and:millis.
 
@@ -6620,10 +6620,10 @@
     ^ self getUserNameFromID:userID
 
     "
-     OperatingSystem getFullUserNameFromID:0 
-     OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID)  
-
-     OperatingSystem getUserNameFromID:(OperatingSystem getUserID)  
+     OperatingSystem getFullUserNameFromID:0
+     OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID)
+
+     OperatingSystem getUserNameFromID:(OperatingSystem getUserID)
     "
 
     "Modified: 15.7.1996 / 12:44:21 / cg"
@@ -6811,7 +6811,7 @@
     "
      OperatingSystem getUserNameFromID:0
      OperatingSystem getUserNameFromID:100
-     OperatingSystem getUserNameFromID:9991 
+     OperatingSystem getUserNameFromID:9991
     "
 !
 
@@ -6821,7 +6821,7 @@
     "return a dictionary filled with userinfo. The argument can be either
      a string with the users name or its numeric id.
      Notice, that not all systems provide (all of) this info;
-     DOS systems return nothing; 
+     DOS systems return nothing;
      non-SYSV4 systems have no age/comment.
      Portable applications may want to check the systemType and NOT depend
      on all keys to be present in the returned dictionary.
@@ -6895,8 +6895,8 @@
     "
      OperatingSystem userInfoOf:'root'
      OperatingSystem userInfoOf:1
-     OperatingSystem userInfoOf:'claus' 
-     OperatingSystem userInfoOf:'fooBar' 
+     OperatingSystem userInfoOf:'claus'
+     OperatingSystem userInfoOf:'fooBar'
      OperatingSystem userInfoOf:(OperatingSystem getUserID)
     "
 ! !
@@ -6922,9 +6922,9 @@
 
     "get status changes from child processes.
      Return an OSProcessStatus or nil, if no process has terminated.
-     If blocking is true, we wait until a process changed state, 
+     If blocking is true, we wait until a process changed state,
      otherwise we return immediately.
-     Note that win32 needs to know the HANDLE of the process on which 
+     Note that win32 needs to know the HANDLE of the process on which
      it waits.  In case of an error, THIS ALWAYS WAITS and then times out."
 
     |pid status code core|
@@ -6988,7 +6988,7 @@
 !
 
 readCheck:fd
-    "return true, if data is available on a filedescriptor 
+    "return true, if data is available on a filedescriptor
      (i.e. read is possible without blocking).
      This depends on a working select or FIONREAD to be provided by the OS."
 
@@ -7048,8 +7048,8 @@
 !
 
 selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray withTimeOut:millis
-    "wait for any fd in readFdArray (an Array of integers) to become ready for 
-     reading, writeFdArray to become ready for writing, or exceptFdArray to 
+    "wait for any fd in readFdArray (an Array of integers) to become ready for
+     reading, writeFdArray to become ready for writing, or exceptFdArray to
      arrive exceptional data (i.e. out-of-band data).
      Timeout after t milliseconds or, if the timeout time is 0, immediately..
      Empty fd-sets will always wait. Zero time can be used to poll file-
@@ -7077,7 +7077,7 @@
 	maxF = -1;
 	if (__isNonNilObject(readFdArray)) {
 	    if (! __isArrayLike(readFdArray)) {
-		goto fail;    
+		goto fail;
 	    }
 	    count = __arraySize(readFdArray);
 
@@ -7096,7 +7096,7 @@
 
 	if (__isNonNilObject(writeFdArray)) {
 	    if (! __isArrayLike(writeFdArray)) {
-		goto fail;    
+		goto fail;
 	    }
 	    count = __arraySize(writeFdArray);
 	    for (i=0; i<count;i++) {
@@ -7104,7 +7104,7 @@
 		if (fd != nil) {
 		    f = __intVal(fd);
 		    if ((unsigned)f < FD_SETSIZE) {
-			FD_SET(f, &wset);       
+			FD_SET(f, &wset);
 			if (f > maxF) maxF = f;
 			numFds++;
 		    }
@@ -7114,7 +7114,7 @@
 
 	if (__isNonNilObject(exceptFdArray)) {
 	    if (! __isArrayLike(exceptFdArray)) {
-		goto fail;    
+		goto fail;
 	    }
 	    count = __arraySize(exceptFdArray);
 	    for (i=0; i<count;i++) {
@@ -7122,7 +7122,7 @@
 		if (fd != nil) {
 		    f = __intVal(fd);
 		    if ((unsigned)f < FD_SETSIZE) {
-			FD_SET(f, &eset);       
+			FD_SET(f, &eset);
 			if (f > maxF) maxF = f;
 			numFds++;
 		    }
@@ -7146,7 +7146,7 @@
 	errno = 0;
 
 	if (t == 0) {
-	    /* 
+	    /*
 	     * if there is no timeout time, we can stay here interruptable.
 	     */
 	    do {
@@ -7155,7 +7155,7 @@
 	} else {
 	    do {
 		ret = select(maxF+1, &rset, &wset, &eset, &wt);
-		/* 
+		/*
 		 * for now: dont loop; if we did, we had to adjust the vt-timeval;
 		 * could otherwise stay in this loop forever ...
 		 * Premature return (before the time expired) must be handled by the caller.
@@ -7242,9 +7242,9 @@
 
 !OpenVMSOperatingSystem::FileStatusInfo class methodsFor:'instance creation'!
 
-type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP 
+type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP
     ^ self basicNew
-	type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP 
+	type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP
 ! !
 
 !OpenVMSOperatingSystem::FileStatusInfo methodsFor:'accessing'!
@@ -7359,7 +7359,7 @@
     recordSize := rs
 !
 
-type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP 
+type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP
     type := t.
     mode := m.
     uid := u.
@@ -7533,6 +7533,6 @@
 !OpenVMSOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OpenVMSOperatingSystem.st,v 1.12 2003-02-27 14:49:24 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/OpenVMSOperatingSystem.st,v 1.13 2004-03-20 19:23:29 stefan Exp $'
 ! !
 OpenVMSOperatingSystem initialize!