summaryrefslogtreecommitdiff
path: root/sysutils/screen49/files/patch-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/screen49/files/patch-misc.c')
-rw-r--r--sysutils/screen49/files/patch-misc.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sysutils/screen49/files/patch-misc.c b/sysutils/screen49/files/patch-misc.c
new file mode 100644
index 000000000000..1364b230d55a
--- /dev/null
+++ b/sysutils/screen49/files/patch-misc.c
@@ -0,0 +1,31 @@
+--- misc.c.orig 2022-01-28 14:06:02 UTC
++++ misc.c
+@@ -28,8 +28,10 @@
+
+ #include <poll.h>
+ #include <sys/types.h>
++#include <sys/user.h>
+ #include <sys/stat.h> /* mkdir() declaration */
+ #include <signal.h>
++#include <libutil.h>
+
+ #include "config.h"
+ #include "screen.h"
+@@ -796,3 +798,17 @@
+ }
+
+ #endif
++
++time_t
++SessionCreationTime(fifo)
++const char *fifo;
++{
++ int pid = atoi(fifo);
++ if (pid <= 0) return 0;
++
++ struct kinfo_proc * kip = kinfo_getproc(pid);
++ if (kip == 0) return 0;
++ time_t start = kip->ki_start.tv_sec;
++ free (kip);
++ return start;
++}