From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/mtio/mtdealloc.x | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sys/mtio/mtdealloc.x (limited to 'sys/mtio/mtdealloc.x') diff --git a/sys/mtio/mtdealloc.x b/sys/mtio/mtdealloc.x new file mode 100644 index 00000000..2f98a972 --- /dev/null +++ b/sys/mtio/mtdealloc.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# MTDEALLOCATE -- Deallocate a previously allocated tape drive. To deallocate +# a drive we try to rewind (any errors, such as drive offline, will result in a +# warning message), and then delete the lockfile. We do not call up the OS to +# deallocate the drive; that is done at a higher level, usually XDEALLOCATE +# (in etc$xalloc.x). + +procedure mtdeallocate (mtname, rewind_tape) + +char mtname[ARB] #I magtape specification +int rewind_tape #I rewind before deallocating drive + +pointer sp, lockfile +errchk mt_glock, syserrs + +begin + call smark (sp) + call salloc (lockfile, SZ_FNAME, TY_CHAR) + + if (rewind_tape == YES) + iferr (call mtrewind (mtname, NO)) + call erract (EA_WARN) + + call mt_sync (OK) + + call mt_glock (mtname, Memc[lockfile], SZ_FNAME) + iferr (call delete (Memc[lockfile])) + ; + + call mt_clrcache() + call sfree (sp) +end -- cgit