1 /* rcmd.c --- execute a command on a remote host from OS/2 2 Karl Fogel <kfogel@cyclic.com> --- November 1995 */ 3 4 #include <io.h> 5 #include <stdio.h> 6 #include <fcntl.h> 7 #include <malloc.h> 8 #include <errno.h> 9 /* <sys/socket.h> wants `off_t': */ 10 #include <sys/types.h> 11 /* This should get us ibmtcpip\include\sys\socket.h: */ 12 #include <sys/socket.h> 13 #include <assert.h> 14 15 #include "rcmd.h" 16 17 void 18 init_sockets () 19 { 20 int rc; 21 22 rc = sock_init (); 23 if (rc != 0) 24 { 25 fprintf (stderr, "sock_init() failed -- returned %d!\n", rc); 26 exit (1); 27 } 28 } 29 30 31 static int 32 resolve_address (const char **ahost, struct sockaddr_in *sai) 33 { 34 fprintf (stderr, 35 "Error: resolve_address() doesn't work.\n"); 36 exit (1); 37 } 38 39 static int 40 bind_and_connect (struct sockaddr_in *server_sai) 41 { 42 fprintf (stderr, 43 "Error: bind_and_connect() doesn't work.\n"); 44 exit (1); 45 } 46 47 static int 48 rcmd_authenticate (int fd, char *locuser, char *remuser, char *command) 49 { 50 fprintf (stderr, 51 "Error: rcmd_authenticate() doesn't work.\n"); 52 exit (1); 53 } 54 55 int 56 rcmd (const char **ahost, 57 unsigned short inport, 58 char *locuser, 59 char *remuser, 60 char *cmd, 61 int *fd2p) 62 { 63 fprintf (stderr, 64 "Error: rcmd() doesn't work.\n"); 65 exit (1); 66 } 67