#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
parse_args(argc, argv, &options);
-#ifdef __linux__
+#if defined (__linux__) || defined(__FreeBSD_kernel__)
setsid();
#endif
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
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;