|
|
1.1 root 1: /* ssapmajor1.c - SPM: initiate majorsyncs */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapmajor1.c,v 7.0 89/11/23 22:25:30 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ssap/RCS/ssapmajor1.c,v 7.0 89/11/23 22:25:30 mrose Rel $
9: *
10: *
11: * $Log: ssapmajor1.c,v $
12: * Revision 7.0 89/11/23 22:25:30 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: /* LINTLIBRARY */
29:
30: #include <stdio.h>
31: #include <signal.h>
32: #include "spkt.h"
33:
34: /* S-MAJOR-SYNC.REQUEST */
35:
36: int SMajSyncRequest (sd, ssn, data, cc, si)
37: int sd;
38: long *ssn;
39: char *data;
40: int cc;
41: struct SSAPindication *si;
42: {
43: SBV smask;
44: int result;
45: register struct ssapblk *sb;
46:
47: missingP (ssn);
48: missingP (si);
49:
50: smask = sigioblock ();
51:
52: ssapPsig (sb, sd);
53: toomuchP (sb, data, cc, SN_SIZE, "majorsync");
54:
55: result = SMajSyncRequestAux (sb, ssn, data, cc, MAP_SYNC_NOEND, si);
56:
57: (void) sigiomask (smask);
58:
59: return result;
60: }
61:
62: /* */
63:
64: int SMajSyncRequestAux (sb, ssn, data, cc, opts, si)
65: register struct ssapblk *sb;
66: long *ssn;
67: char *data;
68: int cc,
69: opts;
70: register struct SSAPindication *si;
71: {
72: int result;
73:
74: if (SDoActivityAux (sb, si, 0, 0) == NOTOK)
75: return NOTOK;
76:
77: if ((sb -> sb_requirements & SR_ACTIVITY)
78: && !(sb -> sb_flags & SB_Vact))
79: return ssaplose (si, SC_OPERATION, NULLCP, "no activity in progress");
80:
81: if (sb -> sb_flags & SB_MAA)
82: return ssaplose (si, SC_OPERATION, "awaiting your majorsync response");
83:
84: if ((result = SWriteRequestAux (sb, SPDU_MAP, data, cc, opts,
85: *ssn = sb -> sb_V_M, 0, NULLSD, NULLSD, NULLSR, si)) == NOTOK)
86: freesblk (sb);
87: else {
88: sb -> sb_flags |= SB_MAP;
89: if (opts & MAP_SYNC_NOEND) {
90: if (sb -> sb_requirements & SR_ACTIVITY)
91: sb -> sb_flags |= SB_Vnextact;
92: }
93: else
94: sb -> sb_flags |= SB_AE, sb -> sb_flags &= ~SB_Vnextact;
95: if (sb -> sb_flags & SB_Vsc) {
96: sb -> sb_V_A = sb -> sb_V_M;
97: sb -> sb_flags &= ~SB_Vsc;
98: }
99: sb -> sb_V_M++;
100: }
101:
102: return result;
103: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.