-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrshlib.c
94 lines (79 loc) · 1.7 KB
/
rshlib.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* RSHLIB.C -- Phil Budne @ BostonU / Distributed Systems
* Common routines for RSHSRV/RSHD
*
* (c) 1986 Boston University.
* Permission granted to copy for non-profit use.
*
* Written using UTAH PCC-20.
*
*/
# include "pcc:stdio.h"
# include "pcc:tops20.h"
# include "pcc:mon_files.h"
# include "pcc:mon_fork.h"
# include "mon_crjob.h"
# include "mon_networks.h"
int punt(jfn, s)
int jfn;
char *s;
{
write(jfn, "\01", 1); /* pass failure code */
write(jfn, s, strlen(s)); /* pass failure string */
write(jfn, "\n", 1); /* send newline */
return( -1 );
}
reljfn(j)
int j;
{
int acs[5];
acs[1] = j;
JSYS(JSrljfn,acs);
} /* reljfn */
int trytcp(name)
char *name;
{
int acs[5], jfn;
ac1 = Value(GJ_sht);
ac2 = POINT(name);
if( JSYS(JSgtjfn,acs) == JSerr )
return( -1 );
jfn = ac1; /* save jfn */
ac2 = 0100400300000; /* 8bit, interactive, rd/wr */
if( JSYS(JSopenf,acs) == JSerr ) {
reljfn(jfn);
return( -1 );
} /* openf failed */
return( jfn );
} /* trytcp */
epcap(fork,i) /* enable process capabilities */
int fork, i;
{
int acs[5];
ac1 = fork;
ac3 = i; /* enable mask */
JSYS(JSepcap,acs); /* perform enable */
} /* epcap */
logout(job)
int job;
{
int acs[5];
ac1 = job;
JSYS(JSlgout,acs); /* blast job */
} /* logout */
int hostname(str, numb) /* convert address to name */
char *str;
int numb;
{
int acs[5];
ac1 = GThns; /* string from address */
ac2 = POINT(str); /* bp to string */
ac3 = numb; /* address */
if( JSYS(JSgthst, acs) == JSerr )
return( -1 );
else
return( 0 );
} /* hostname */
/** Local Modes: * */
/** Comment Column:40 * */
/** End: * */