Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ucbvax.UUCP Path: utzoo!linus!decvax!tektronix!ucbcad!ucbvax!root From: root@ucbvax.UUCP Newsgroups: fa.info-vax Subject: Re: Invoking the overdraft... Message-ID: <95@ucbvax.UUCP> Date: Mon, 10-Oct-83 04:52:18 EDT Article-I.D.: ucbvax.95 Posted: Mon Oct 10 04:52:18 1983 Date-Received: Thu, 13-Oct-83 06:58:26 EDT Sender: root@ucbvax.UUCP Organization: U. C. Berkeley Computer Science Lines: 61 From GEOFF5@SRI-CSL Mon Oct 10 01:52:06 1983 Here's how overdraft works: (assume you start under your permanent quota) You do a $PUT that requires that the file be extended. The ACP checks and sees that you would exceed your permanent quota and returns the error SS$_EXDISKQUOTA, but notes this fact in the Window Control Block. The next time it is called it checks against permanent+overdraft because the overdraft flag is set for that file. In the "gray area" it returns the alternate success code SS$_OVRDSKQUOTA. RMS does NOT return this to the user (the $PUT returns RMS$_NORMAL; STV contains the 2nd longword of the IOSB). How to use it: If a $PUT fails with STS'STV = RMS$_EXT'SS$_EXDISKQUOTA retry the $PUT. If it succeeds you are now in the "gray area" (if not you are past the overdraft). High-level language experiment: (I don't program in DEC PASCAL for "religious reasons" but I understand that there is a PAS$RAB function that lets you play similar games, which are left as an exercise to the reader.) Program OverDraft C Attempt to utilize disk overdraft from FORTRASH Integer*4 I Open (Unit=21,File='OUTFILE',CarriageControl='LIST', * Status='NEW') Do 20 I=1,999 10 Format (I4,' The quick brown fox jumps over the lazy dog *''s back') Write (21,10,Err=25) I 20 Continue Stop C For some reason a WRITE has failed! 25 Call Check(%Val(For$RAB(21)),I) Go To 20 End C This is what I have to put up with in a language that C doesn't have pointers...at least it doesn't type check Subroutine Check(RAB,I) Integer*4 RAB(0:*),I,Sys$Put 50 Format (' I=',I4,' STS=',Z8.8,' STV=',Z8.8) Type 50,I,RAB(2),RAB(3) If (.Not.Sys$Put(RAB)) Then 60 Format (' Retry: STS=',Z8.8,' STV=',Z8.8) Type 60,RAB(2),RAB(3) Stop End If End Observations: Something trashes STS'STV before CHECK gets called. Other than that it seems to work. Conclusions: You can't easily take advantage of overdrafts from high level languages. DEC should provide better support at the RMS level. -=EPS=- ------