chiark / gitweb /
prefork-interp: pass startup mtime
[chiark-utils.git] / cprogs / prefork-interp.c
index fb1be68389878b42bdf5dff92809744190db8513..0b4988d36d2ba3c581355315a722f0997fcf7138 100644 (file)
@@ -724,11 +724,14 @@ void become_setup(int sfd, int lockfd, int fake_pair[2],
 
   // Extension could work like this:
   //
-  // We advertise a new protocol (perhaps one which is nearly entirely
+  // We could advertise a new protocol (perhaps one which is nearly entirely
   // different after the connect) by putting a name for it comma-separated
   // next to "v1".  Simple extension can be done by having the script
   // side say something about it in the ack xdata, which we currently ignore.
-  putenv(m_asprintf("PREFORK_INTERP=v1 %d,%d,%d,%d",
+  // Or we could add other extra data after v1.
+  putenv(m_asprintf("PREFORK_INTERP=v1,%jd.%09ld %d,%d,%d,%d",
+                    (intmax_t)initial_stab.st_mtim.tv_sec,
+                    (long)initial_stab.st_mtim.tv_nsec,
                    sfd, call_fd, watcher_stdin, watcher_stderr));
 
   execvp(executor_argv[0], (char**)executor_argv);