summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 3c30a5fef..a7044f0ff 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -10,6 +10,7 @@
*
* This program is freely distributable.
*/
+
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@@ -44,6 +45,12 @@
#include "widechar.h"
#include "ttyutils.h"
+#if defined(__FreeBSD_kernel__)
+#include <pty.h>
+#include <sys/param.h>
+#endif
+
+
#ifdef __linux__
# include <sys/kd.h>
# include <sys/param.h>
@@ -76,6 +83,10 @@
# endif
#endif
+#ifdef __FreeBSD_kernel__
+#define USE_SYSLOG
+#endif
+
/* If USE_SYSLOG is undefined all diagnostics go to /dev/console. */
#ifdef USE_SYSLOG
# include <syslog.h>
@@ -1110,6 +1121,11 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
op->term = DEFAULT_TTYS1;
}
#endif
+
+#if defined(__FreeBSD_kernel__)
+ login_tty (0);
+#endif
+
/*
* Detect if this is a virtual console or serial/modem line.
* In case of a virtual console the ioctl KDGKBMODE succeeds