xref: /openbsd/gnu/usr.bin/cvs/os2/rcmd.c (revision 2770ece5)
1 /* rcmd.c --- execute a command on a remote host from OS/2
2    Karl Fogel <kfogel@cyclic.com> --- November 1995  */
3 
4 /* This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.  */
13 
14 #include <io.h>
15 #include <stdio.h>
16 #include <fcntl.h>
17 #include <malloc.h>
18 #include <errno.h>
19 /* <sys/socket.h> wants `off_t': */
20 #include <sys/types.h>
21 /* This should get us ibmtcpip\include\sys\socket.h: */
22 #include <sys/socket.h>
23 #include <assert.h>
24 
25 #include "rcmd.h"
26 
27 void
init_sockets()28 init_sockets ()
29 {
30 	int rc;
31 
32 	rc = sock_init ();
33     if (rc != 0)
34     {
35       fprintf (stderr, "sock_init() failed -- returned %d!\n", rc);
36       exit (1);
37     }
38 }
39 
40 
41 static int
resolve_address(const char ** ahost,struct sockaddr_in * sai)42 resolve_address (const char **ahost, struct sockaddr_in *sai)
43 {
44     fprintf (stderr,
45              "Error: resolve_address() doesn't work.\n");
46     exit (1);
47 }
48 
49 static int
bind_and_connect(struct sockaddr_in * server_sai)50 bind_and_connect (struct sockaddr_in *server_sai)
51 {
52     fprintf (stderr,
53              "Error: bind_and_connect() doesn't work.\n");
54     exit (1);
55 }
56 
57 static int
rcmd_authenticate(int fd,char * locuser,char * remuser,char * command)58 rcmd_authenticate (int fd, char *locuser, char *remuser, char *command)
59 {
60     fprintf (stderr,
61              "Error: rcmd_authenticate() doesn't work.\n");
62     exit (1);
63 }
64 
65 int
rcmd(const char ** ahost,unsigned short inport,char * locuser,char * remuser,char * cmd,int * fd2p)66 rcmd (const char **ahost,
67       unsigned short inport,
68       char *locuser,
69       char *remuser,
70       char *cmd,
71       int *fd2p)
72 {
73     fprintf (stderr,
74              "Error: rcmd() doesn't work.\n");
75     exit (1);
76 }
77