summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--login-utils/Makefile.am1
-rw-r--r--login-utils/agetty.c15
-rw-r--r--sys-utils/ipcs.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am
index 5ed581b8..0386cee4 100644
--- a/login-utils/Makefile.am
+++ b/login-utils/Makefile.am
@@ -11,6 +11,7 @@ EXTRA_DIST = README.getty README.modems-with-agetty README.poeigl
if BUILD_AGETTY
sbin_PROGRAMS += agetty
dist_man_MANS += agetty.8
+agetty_LDADD = -lutil
endif
if BUILD_INIT
diff --git a/login-utils/agetty.c b/login-utils/agetty.c
index 90a64b33..817ec05f 100644
--- a/login-utils/agetty.c
+++ b/login-utils/agetty.c
@@ -37,7 +37,11 @@
#include "nls.h"
#include "pathnames.h"
-#ifdef __linux__
+#if defined(__FreeBSD_kernel__)
+#include <pty.h>
+#endif
+
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
#include <sys/param.h>
#define USE_SYSLOG
#endif
@@ -281,7 +285,7 @@ main(argc, argv)
parse_args(argc, argv, &options);
-#ifdef __linux__
+#if defined (__linux__) || defined(__FreeBSD_kernel__)
setsid();
#endif
@@ -670,6 +674,13 @@ open_tty(tty, tp, local)
if (tcgetattr(0, tp) < 0)
error("%s: tcgetattr: %m", tty);
+ /*
+ * login_tty: steal tty from other process group.
+ */
+#if defined(__FreeBSD_kernel__)
+ login_tty (0);
+#endif
+
/*
* It seems to be a terminal. Set proper protections and ownership. Mode
* 0622 is suitable for SYSV <4 because /bin/login does not change
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 55d5c80f..1567f9a6 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -499,8 +499,10 @@ void do_msg (char format)
case STATUS:
printf (_("------ Messages: Status --------\n"));
+#ifndef __FreeBSD_kernel__
printf (_("allocated queues = %d\n"), msginfo.msgpool);
printf (_("used headers = %d\n"), msginfo.msgmap);
+#endif
printf (_("used space = %d bytes\n"), msginfo.msgtql);
return;