qdosmsq:traps:trap_3:trnc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:trnc [2009/05/27 16:59] (current)
george.gwilt created
Line 1: Line 1:
 +====== FS_TRUNCATE/​IOF_TRNC ======
 +
 +This trap truncates a file to the current position.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$4B|D0.L|Error return.|
 +|D1.L| |D1.L|Corrupted.|
 +|D3.W|Timeout |D3.L|Preserved.|
 +|A0.L|Channel ID |A0.L|Preserved.|
 +|A1.L| |A1.L|Corrupted.|
 +
 +===== Errors =====
 +Any sub system IO errors including
 +|ERR_NC|Not complete.|
 +
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 + 
 +
 +===== Example =====
 +The example below shows the use of this trap call to truncate a file to the position set in D1.L. It is assumed that A0 contains the file's ID.
 +
 +<​code>​
 +trnc    moveq   #​fs_posab,​d0 ​   ; $42
 +        moveq   #​-1,​d3 ​         ; Timeout
 +        trap    #3              ; Set the position
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!
 +        moveq   #​fs_truncate,​d0 ; $4B
 +        trap    #3              ; Truncate
 +        tst.l   ​d0 ​             ; OK? . .
 +        bne     ​error ​          ; . . no!        ​
 +       
 +</​code>​
 +
  
  • qdosmsq/traps/trap_3/trnc.txt
  • Last modified: 2009/05/27 16:59
  • by george.gwilt