// 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);
our @call_fds;
our $socket_path;
our $fail_log = 0;
+our $startup_mtime;
sub fail_log ($) {
my ($m) = @_;
my @env_data = split / /, ($ENV{$env_name} // return);
croak "$env_name has too few words" unless @env_data >= 2;
my (@vsns) = split /,/, $env_data[0];
- croak "$env_name doesn't offer protocol v1" unless grep { $_ eq 'v1' } @vsns;
+ croak "$env_name doesn't specify v1" unless @vsns >= 2 && $vsns[0] eq 'v1';
+ $startup_mtime = $vsns[1];
my @env_fds = split /,/, $env_data[1];
croak "$env_name has too few fds" unless @env_fds >= 4;;
$#env_fds = 3;