summaryrefslogtreecommitdiff
path: root/sysutils/screen/files/patch-misc.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2025-06-08 23:04:45 -0700
committerCy Schubert <cy@FreeBSD.org>2025-06-08 23:15:01 -0700
commit9edb6f7cb095776f328686649b37e52c8429a6d6 (patch)
treea72c1fa2afcde9a99f801e46f15408fe6ae27c1f /sysutils/screen/files/patch-misc.c
parentdevel/task: update to 3.44.0 (diff)
sysutils/screen: Replace sysutils/screen with sysutils/screen50
Remove sysutils/screen and rename sysutils/screen50 to sysutils/screen.
Diffstat (limited to 'sysutils/screen/files/patch-misc.c')
-rw-r--r--sysutils/screen/files/patch-misc.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/sysutils/screen/files/patch-misc.c b/sysutils/screen/files/patch-misc.c
new file mode 100644
index 000000000000..238359b03671
--- /dev/null
+++ b/sysutils/screen/files/patch-misc.c
@@ -0,0 +1,39 @@
+--- misc.c.orig 2024-03-26 16:41:57.000000000 -0700
++++ misc.c 2024-04-03 11:32:35.844473000 -0700
+@@ -32,8 +32,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 <stdint.h>
+ #include <string.h>
+ #include <stdbool.h>
+@@ -225,6 +227,7 @@
+ char *p;
+
+ if (str == NULL) {
++
+ *buf = 0;
+ return 0;
+ }
+@@ -238,3 +241,17 @@
+ *p = 0;
+ return p - buf;
+ }
++
++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;
++}