00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 static char USMID[] = "@(#) libf/tape/c1/gettp.c 92.0 10/08/98 14:30:10";
00038
00039 #include <errno.h>
00040 #include <ffio.h>
00041 #include <liberrno.h>
00042 #include "fio.h"
00043
00044 #define ERET(errcd) { *istat=errcd; goto ret; }
00045
00046
00047
00048
00049 void
00050 GETTP(_f_int *unump, _f_int *len, _f_int8 *pa, _f_int *synch, _f_int *istat)
00051 {
00052 int ss;
00053 unit *cup;
00054 struct ffc_gettp_s gtptr;
00055
00056 STMT_BEGIN(*unump, 0, T_TAPE, NULL, NULL, cup);
00057
00058
00059
00060 if (cup == NULL) {
00061 cup = _implicit_open(SEQ, UNF, *unump, 1, &ss);
00062 if (cup == NULL)
00063 ERET(ss);
00064 }
00065
00066 *istat = 0;
00067
00068 switch(cup->ufs) {
00069 case FS_FDC:
00070 #ifdef __mips
00071 gtptr.ffc_pa = (long long *)pa;
00072 #else
00073 gtptr.ffc_pa = (long *)pa;
00074 #endif
00075 gtptr.ffc_glen = *len;
00076 gtptr.ffc_synch = *synch;
00077 ss = XRCALL(cup->ufp.fdc, fcntlrtn) cup->ufp.fdc,
00078 FC_GETTP, >ptr, &cup->uffsw);
00079 if (ss < 0)
00080 *istat = cup->uffsw.sw_error;
00081 break;
00082 default:
00083 ERET(FECONNTP);
00084 }
00085
00086 ret:
00087 STMT_END(cup, T_TAPE, NULL, NULL);
00088 return;
00089
00090 }
00091