                  <<< DOCD$:[NOTES$LIBRARY]SCT-RAVEN.NOTE;1 >>>
                         -< The SCT Raven conference >-
================================================================================
Note 133.0           rms-f-cur regression introduced in V7.1          No replies
EVMS::RCASE_SMITH "{VDE SCT}"                       707 lines   2-JAN-1997 12:58
--------------------------------------------------------------------------------


              <<< STAR::NOTESD$:[NOTES$LIBRARY]SCT-RAVEN.NOTE;1 >>>
                       -< SCT Conference for Raven VAX >-
================================================================================
Note 64.0        CRTL -- rms-f-cur regression introduced in V7.1      No replies
STAR::RCASE_SMITH                                   698 lines   2-JAN-1997 12:56
--------------------------------------------------------------------------------
$!      Project:              CRTL/ACRTL
$!      Project Leader:       Duane Smith
$!      Development Stream:   Raven FT1
$!      Checkin Type:         Bug fix
$!
$!
$!      Problem Overview:
$!
$!      Users upgrading to OpenVMS V7.1 have discovered a regression which
$!      causes calls to the read function to fail with a rms-f-cur error
$!      which is "no current record (operation not preceded by $get/$find)".
$!      
$!
$!      Diagnosis:
$!
$!      TURRIS::DECC note 2048 revealed the problem with writing the file
$!      accessed in record mode when no preloading is done.
$!
$!      The record to be updated must be read into the CRTL internal buffer
$!      before the buffer is modified and before the $UPDATE service is
$!      called. If the first record was not preloaded, an attempt to modify
$!      it without any intervening read operation results in "RMS-F-CUR, no
$!      current record" status returned from $UPDATE.
$!
$!
$!      Cure:
$!
$!      Add preload_pending flag to the fcb structure. This flag is set by
$!      the decc$$aux_open routine if no preloading is done. Every user
$!      output function (see list below) examines this flag and, if set,
$!      calls preload virtual function. If decc$$record_get routine which is
$!      preload virtual function for a file accessed in record mode,
$!      succeeds, it clears the flag. (Note, that for decc$$record_get
$!      success if either RMS$_NORMAL or RMS$_EOF status returned from $GET.
$!      In latter case fcb->real_eof flag is set and decc$$record_put
$!      routine will call the $PUT instead of $UPDATE).
$!
$!      If the preload virtual function fails (for example, if the record is
$!      locked by another stream), the user output function returns with
$!      unsuccessful status and with errno and vaxc$errno set by
$!      decc$$record_get (%RMS-E-RLK in case of record lock).
$!
$!      In V6.2 and V7.0, for example, the status of preload virtual
$!      function is not checked and in case of failure, the user output
$!      function is doing a meaningless work transferring the user data into
$!      the CRTL internal buffer.
$!
$!      The user output function can even return with successful status, but
$!      the first attempt to flush the data (on fclose, for example) results
$!      in "%RMS-F-CUR, no current record" status.
$!
$!      The current behaviour when the user output function fails with the
$!      real RMS failure status in vaxc$errno seems to be much better.
$!
$!      Follows the list of modifications done to each of the mentioned
$!      above modules:
$!
$!        . VAXCIO.SRC    - added preload_pending flag to the fcb structure and
$!                          introduced the macros manipulating this flag:
$!
$!                                o c$$set_preload_pending
$!                                o c$$clear_preload_pending
$!                                o c$$test_preload_pending
$!
$!        . F_AUX_OPEN.C  - the decc$$aux_open routine sets preload_pending
$!                          flag if no preloading is performed.
$!
$!                          The module contains also the following edit to
$!                          the decc$$aux_open routine: the routine performs
$!                          now preloading for an empty file (FAB$L_ALQ is
$!                          zero) regardless of sharing options specified.
$!                          This is in line with our current policy
$!                          regarding preloading which says: to minimize the
$!                          risk of breaking the old behaviour, perform
$!                          preloading in every case when it is clear, that
$!                          the record will not be locked by RMS. For empty
$!                          file there is no to lock and decc$$record_get
$!                          will just set fcb->real_eof flag.
$!
$!        . F_RECORDIO.C  - in case of success the decc$$record_get routine
$!                          clears preload_pending flag
$!
$!
$!      The following user functions call c$$test_preload_pending macro:
$!
$!        Module          Function
$!        ======          ========
$!
$!        F_RMSIO.C       decc$record_write
$!        F_SIMPLEIO.C    fputc, decc$nolock_putchar, putchar, fputs, puts, putw
$!        F_WRITE.C       write, fwrite
$!        F_WSIMPLEIO.C   fputwc, fputws
$!
$!      Other user output functions: putc from F_SIMPLEIO.C module and putwc
$!      and putwchar from F_WSIMPLEIO.C module do not need to be modified
$!      because they call one of the function above.
$!
$!
$!      Platforms affected: 
$! 
$!      Both VAX and Alpha at this time 
$! 
$! 
$!      Modules: 
$! 
$!      [A/CRTL]F_AUX_OPEN.C
$!      [A/CRTL]F_READ.C
$!      [A/CRTL]F_RECORDIO.C
$!      [A/CRTL]F_RMSIO.C
$!      [A/CRTL]F_SIMPLEIO.C
$!      [A/CRTL]F_WRITE.C
$!      [A/CRTL]F_WSIMPLEIO.C
$!      [A/CRTL]VAXCIO.SRC
$! 
$! 
$!      Affected Images (if feasible):
$! 
$!      [SYSLIB]DECC$SHR.EXE 
$! 
$! 
$!      Impact/Risks: 
$!
$!      Low 
$! 
$! 
$!      How this change was Tested: 
$! 
$!      Tests CRTL1648, CRTL1648A and CRTL1648B were added.
$!
$!      Test CRTL1648 verifies how the following user output functions
$!      update the first record of the shared file (no preloading is done
$!      for shared file):
$!
$!        . write, fwrite, fputs, putc, fputc, putw, fputwc, fputws, 
$!        . decc$record_write
$!
$!      Test CRTL1648A is the same that CRTL1648, but the record is locked
$!      by another stream and RMS$_RLK status is expected from all the user
$!      output functions.
$!
$!      Test CRTL1648B is the same that CRTL1648, but in addition it checks
$!      fflush, fsync, fseek and lseek function.
$!
$!      The tests are based on the same module: COMMON_CRTL1648.C.
$!
$!      Existing test EPS1050A.C was expecting RMS$_CUR status in vaxc$errno
$!      after write call when the record to be updated couldn't be read due
$!      to RMS lock. The test was modified so, that expected vaxc$errno
$!      value is RMS$_RLK.
$!
$! 
$!      Associated QARs,CLDs,SPRs: 
$!
$!      CRTL_INTERNAL 1648 (TURRIS::DECC 2048)
$!      CRTL_INTERNAL 1650
$! 
$! 
$!      (Optional) Comments: None. 
$! 
$!      (Optional) Special Build Instructions: None. 
$!

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:35
   (1)  WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;2 Line 326  
      1) *
      1) *	075	Boris Gubenko		26-Dec-1996
      1) *		crtl1648: Add preload_pending flag and introduce
      1) *		c$$*_preload_pending macros
      1) *
      1) *	076	Boris Gubenko		29-Dec-1996
      1) *		Add UNLOCK_FCB and UNSUCCESSFUL_STATUS parameters to the
      1) *		c$$test_preload_pending macro and change the macro so, that if
      1) *		fcb->preloadf virtual function fails, the fcb is unlocked, if
      1) *		appropriate, and the calling routine returns with specified
      1) *		unsuccessful status.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;2 Line 723  
      1)	wide_oriented:1,    /* wide-oriented stream */
      1)	preload_pending:1;  /* indicates, that no preload was done */

File WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;1 Line 712  
      2)	wide_oriented:1;    /* wide-oriented stream */
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]VAXCIO.SRC;2 Line 1457 
      1)<PAGE>
      1)/* preload_pending macros. */
      1)#define c$$set_preload_pending(fcb)   ( (fcb)->preload_pending = 1 )
      1)#define c$$clear_preload_pending(fcb) ( (fcb)->preload_pending = 0 )
      1)#define c$$test_preload_pending(fcb,UNLOCK_FCB,UNSUCCESSFUL_STATUS) \
      1)    if ((fcb)->preload_pending) { \
      1)	if ( (fcb)->preloadf((fcb), TRUE, TRUE) == -1 ) { \
      1)	    if ( UNLOCK_FCB ) \
      1)		c$$unlock_fcb_ast(fcb); \
      1)	    return (UNSUCCESSFUL_STATUS); \
      1)	} \
      1)	else \
      1)	    c$$clear_preload_pending(fcb); \
      1)    }
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:28
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;2 Line 2    
      1)#module c$wsimpleio EDIT_LEVEL(20)

File WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;1 Line 2    
      2)#module c$wsimpleio EDIT_LEVEL(19)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;2 Line 122  
      1) *
      1) *	020	Boris Gubenko	29-Dec-1996
      1) *		In every output user function call c$$test_preload_pending()
      1) *		before calling a low-level auxiliary output routine.
      1) *		c$$test_preload_pending() will bring the first file record in
      1) *		the buffer, if appropriate. This is necessary in the case when
      1) *		the first record was not preloaded and there were no read
      1) *		operations on the stream so far. CRTL 1648.
      1) *
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;2 Line 796  
      1)    c$$test_preload_pending(fcb,TRUE,WEOF); /* [020] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WSIMPLEIO.C;2 Line 978  
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [020] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:31
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2 Line 3    
      1)#module	c$write  EDIT_LEVEL(11)

File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;1 Line 3    
      2)#module	c$write  EDIT_LEVEL(9)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2 Line 7    
      1) *  copyright (c) 1990,1995,1996	                                     *

File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;1 Line 7    
      2) *  copyright (c) 1990,1995		                                     *
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2 Line 81   
      1) *
      1) *	010	Boris Gubenko 26-Dec-1996
      1) *		In write() and fwrite() routines call c$$test_preload_pending()
      1) *		before calling a low-level auxiliary output routine.
      1) *		c$$test_preload_pending() will bring the first file record in
      1) *		the buffer, if appropriate. This is necessary in the case when
      1) *		the first record was not preloaded and there were no read
      1) *		operations on the stream so far. CRTL 1648.
      1) *
      1) *	011	Boris Gubenko 29-Dec-1996
      1) *		Pass UNLOCK_FCB and UNSUCCESSFUL_STATUS parameters to the
      1) *		c$$test_preload_pending macro.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2 Line 116  
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [010], [011] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_WRITE.C;2 Line 175  
      1)    c$$test_preload_pending(fcb,TRUE,(0)); /* [010], [011] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:25
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 3    
      1)#module	c$simpleio EDIT_LEVEL(39)	/* Simple I/O routines */

File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;1 Line 3    
      2)#module	c$simpleio EDIT_LEVEL(35)	/* Simple I/O routines */
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 224  
      1) *
      1) *	036	Duane Smith 22-Nov-1996
      1) *		Matt's testing revealed a place where fputs did not unlock
      1) *              the FCB before returning.  puts had already been fixed.
      1) *
      1) *	037	Boris Gubenko 26-Dec-1996
      1) *		In every output user function call c$$test_preload_pending()
      1) *		before calling a low-level auxiliary output routine.
      1) *		c$$test_preload_pending() will bring the first file record in
      1) *		the buffer, if appropriate. This is necessary in the case when
      1) *		the first record was not preloaded and there were no read
      1) *		operations on the stream so far. CRTL 1648.
      1) *
      1) *	038	Boris Gubenko 29-Dec-1996
      1) *		Pass UNLOCK_FCB and UNSUCCESSFUL_STATUS parameters to the
      1) *		c$$test_preload_pending macro.
      1) *
      1) *	039	Boris Gubenko 31-Dec-1996
      1) *		crtl 1650: remove unbalanced call to c$$unlock_fcb_ast() in
      1) *		decc$nolock_putchar() routine.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 851  
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 918  
      1)    c$$test_preload_pending(fcb,FALSE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;1 Line 911  
      2)		c$$unlock_fcb_ast(fcb);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 973  
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 1035 
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 1072 
      1)	if (ret<0) {
      1)	    c$$unlock_fcb_ast(fcb);
      1)	    return ret;
      1)	}

File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;1 Line 1045 
      2)	if (ret<0) return ret;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 1119 
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_SIMPLEIO.C;2 Line 1189 
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [037], [038] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:21
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;2 Line 3    
      1)#module	c$rmsio EDIT_LEVEL(9)	/* Generic RMS I/O */

File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;1 Line 3    
      2)#module	c$rmsio EDIT_LEVEL(7)	/* Generic RMS I/O */
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;2 Line 7    
      1) *  copyright (c) 1990,1992,1994,1996 				             *

File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;1 Line 7    
      2) *  copyright (c) 1990,1992					             *
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;2 Line 70   
      1) *
      1) *	008	Boris Gubenko 26-Dec-1996
      1) *		In decc$record_write() routine call c$$test_preload_pending()
      1) *		before calling a low-level auxiliary output routine.
      1) *		c$$test_preload_pending() will bring the first file record in
      1) *		the buffer, if appropriate. This is necessary in the case when
      1) *		the first record was not preloaded and there were no read
      1) *		operations on the stream so far. CRTL 1648.
      1) *
      1) *	009	Boris Gubenko 29-Dec-1996
      1) *		Pass UNLOCK_FCB and UNSUCCESSFUL_STATUS parameters to the
      1) *		c$$test_preload_pending macro.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RMSIO.C;2 Line 244  
      1)    c$$test_preload_pending(fcb,TRUE,(-1)); /* [008], [009] */
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:17
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;2 Line 3    
      1)#module	c$recordio EDIT_LEVEL(60)	/* Record File I/O */

File WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;1 Line 3    
      2)#module	c$recordio EDIT_LEVEL(59)	/* Record File I/O */
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;2 Line 350  
      1) *	060	Boris Gubenko	30-Dec-1996
      1) *              CRTL 1648 -- in decc$$record_get() routine clear preload_pending
      1) *		flag if SYS$GET succeeded or EOF was encountered (note, that
      1) *		EOF condition is always considered as a success for
      1) *		decc$$record_get).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;2 Line 514  
      1)
      1)	/*
      1)	**  [060]
      1)	**  Clear preload_pending flag. This flag is tested by all the output
      1)	**  routines to decide whether the preloading routine should be called
      1)	**  before the write operation.
      1)	**
      1)	**  EOF condition is considered as success here and, since fcb->real_eof
      1)	**  flag is set, the decc$*_put routines will call SYS$PUT instead of
      1)	**  SYS$UPDATE.
      1)	*/
      1)	c$$clear_preload_pending(fcb);
      1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_RECORDIO.C;2 Line 559  
      1)    **  [060]
      1)    **  Clear preload_pending flag. This flag is tested by all the output
      1)    **  routines to decide whether the preloading routine should be called
      1)    **  before the write operation.
      1)    */
      1)    c$$clear_preload_pending(fcb);
      1)
      1)    /*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:13
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_READ.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 3    
      1)#module	c$read EDIT_LEVEL(11)	/* read, fread */

File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;1 Line 3    
      2)#module	c$read EDIT_LEVEL(10)	/* read, fread */
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 7    
      1) *  copyright (c) 1990 - 1997					             *

File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;1 Line 7    
      2) *  copyright (c) 1990,1991					             *
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 78   
      1) *
      1) *	011	Boris Gubenko	02-Jan-1997
      1) *              crtl 1649: verify, that arguments of size_t type of (read) and
      1) *		(fread) functions give a positive number when converted to
      1) *		signed int type.
      1) *		In (fread) function verify also, that the number of bytes to be
      1) *		read (multiple of s and n arguments) can be represented by an
      1) *		integer (does not exceed INT_MAX).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 95   
      1)#include <lib$routines.h>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 112  
      1)    /*
      1)    **  [011] Validate parameter of a positive signed integer
      1)    */
      1)    if ((int)n < 0) {

File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;1 Line 103  
      2)    if (n < 0) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 158  
      1)    int multiplier = s, multiplicand = n, addend = 0, product[2];
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;2 Line 167  
      1)    **  [011] Validate parameters of a positive signed integers
      1)    */
      1)    if ( (int)s < 0 || (int)n < 0) {
      1)	cma$tis_errno_set_value(EINVAL);
      1)	return(-1);
      1)    }
      1)
      1)    /*
      1)    **  [011] The number of bytes to be read must be represented by
      1)    **  a positive integer
      1)    */
      1)    (void) lib$emul(&multiplier, &multiplicand, &addend, product);
      1)    if ( product[1] != 0 || product[0] < 0 ) {
      1)	cma$tis_errno_set_value(EINVAL);
      1)	return(-1);
      1)    }
      1)
      1)    maxlen = product[0];
      1)
      1)    /*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_READ.C;1 Line 169  
      2)    **  Determine the maximum number of characters to allow
      2)    */
      2)    maxlen = n * s;
      2)
      2)    /*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

DEC/CMS File Comparison Utility
Files Compared By RCASE_SMITH On  2-JAN-1997 12:53:11
   (1)  WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;2
   (2)  WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;1


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;2 Line 2    
      1)#module	c$aux_open EDIT_LEVEL(135)

File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;1 Line 2    
      2)#module	c$aux_open EDIT_LEVEL(133)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;2 Line 891  
      1) *
      1) *	134	Boris Gubenko		   23-Dec-1996
      1) *		Allow preloading for an empty file (fab$l_alq is zero) to be
      1) *		fully compatible with pre-V7.1 code which unconditionally called
      1) *		preloadf(). If the file is empty, there is no risk of RMS
      1) *		locking, but decc$$record_get() routine, called for empty file,
      1) *		sets fcb->real_eof flag. It turned out, that setting this flag
      1) *		is necessary for decc$$record_put() to work properly. This
      1) *		setting was missing. CRTL 1648.
      1) *
      1) *	135	Boris Gubenko		   26-Dec-1996
      1) *		If no preloading was done, set preload_pending flag via call to
      1) *		c$$set_preload_pending macro. This flag is tested by every
      1) *		output routine to prevent situation, when the first file record
      1) *		is going to be modified without any intervening read operation
      1) *		between the call to open()/fopen() and the call to the output
      1) *		routine. Continuation of CRTL 1648 work.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;2 Line 2867 
      1)	     !fcb->fab->fab$b_shr || !fcb->fab->fab$l_alq ||

File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;1 Line 2850 
      2)	     !fcb->fab->fab$b_shr ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
File WORK4:[RCASE_SMITH.EAGLE]F_AUX_OPEN.C;2 Line 2892 
      1)
      1)	    /*
      1)	    ** [135]
      1)	    **
      1)	    ** Set preload_pending flag.
      1)	    **
      1)	    ** This flag is tested by every output routine to prevent
      1)	    ** situation, when the first file record is going to be modified
      1)	    ** without any intervening read operation between the call to
      1)	    ** open()/fopen() and the call to the output routine.
      1)	    */
      1)	    c$$set_preload_pending(fcb);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



**** End of Differences ****

