aboutsummaryrefslogtreecommitdiff
path: root/sys/etc/prenvset.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/etc/prenvset.x')
-rw-r--r--sys/etc/prenvset.x24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/etc/prenvset.x b/sys/etc/prenvset.x
new file mode 100644
index 00000000..6c21133d
--- /dev/null
+++ b/sys/etc/prenvset.x
@@ -0,0 +1,24 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+# PRENVSET -- Change the value of an environment variable in a connected child
+# process, or in all connected subprocesses if pid=0.
+
+procedure prenvset (pid, envvar, valuestr)
+
+int pid # process id of child, or 0 for all subprocesses
+char envvar[ARB] # name of environment variable
+char valuestr[ARB] # value of environment variable
+pointer sp, cmd
+
+begin
+ call smark (sp)
+ call salloc (cmd, SZ_COMMAND, TY_CHAR)
+
+ call strcpy ("set ", Memc[cmd], SZ_COMMAND)
+ call strcat (envvar, Memc[cmd], SZ_COMMAND)
+ call strcat ("=", Memc[cmd], SZ_COMMAND)
+ call strcat (valuestr, Memc[cmd], SZ_COMMAND)
+
+ call prupdate (pid, Memc[cmd], NO)
+ call sfree (sp)
+end