aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/bootlib/oscmd.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /unix/boot/bootlib/oscmd.c
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'unix/boot/bootlib/oscmd.c')
-rw-r--r--unix/boot/bootlib/oscmd.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/unix/boot/bootlib/oscmd.c b/unix/boot/bootlib/oscmd.c
new file mode 100644
index 00000000..0f9c9755
--- /dev/null
+++ b/unix/boot/bootlib/oscmd.c
@@ -0,0 +1,27 @@
+/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+ */
+
+#include <string.h>
+#include "bootlib.h"
+
+#define SZ_CMD 2048
+
+/* OS_CMD -- Send a command to the host system.
+ */
+int
+os_cmd (char *cmd)
+{
+ PKCHAR x_cmd[SZ_CMD+1];
+ PKCHAR nullstr[1];
+ XINT status;
+ extern int ZOSCMD();
+
+
+ strncpy ((char *)x_cmd, cmd, SZ_CMD);
+ nullstr[0] = 0;
+
+ /* Terminate the parent process if the OS command is interrupted.
+ */
+ ZOSCMD (x_cmd, nullstr, nullstr, nullstr, &status);
+ return (status);
+}