Description: Fix FTBFS for kFreeBSD. Closes: #347549

--- a/logfile.c
+++ b/logfile.c
@@ -25,7 +25,7 @@
 #include <syslog.h>
 
 #if !defined(linux) && !defined(BSD) && !defined(_SCO_DS) && \
-    !defined(SVR42) && !defined(solaris2) && !defined(_AIX)
+    !defined(SVR42) && !defined(solaris2) && !defined(_AIX) && !defined(__GLIBC__)
 int openlog _PROTO(( char *, int, int ));
 int syslog _PROTO(( int, char *, ... ));
 #endif
--- a/mgetty.h
+++ b/mgetty.h
@@ -365,7 +365,7 @@ int getdiskstats _PROTO ((char *path, mn
 extern char * mktemp _PROTO(( char * template ));
 
 #if  !defined(linux) && !defined(SVR4) && !defined(__hpux) && \
-     !defined(BSD) && !defined(M_UNIX) && !defined(_AIX)
+     !defined(BSD) && !defined(M_UNIX) && !defined(_AIX) && !defined(__GLIBC__)
 extern int	getopt _PROTO(( int, char **, char * ));
 #endif
 extern int	optind;
--- a/tio.c
+++ b/tio.c
@@ -45,7 +45,7 @@
 
 /* some systems do not define all flags needed later, e.g. NetBSD */
 
-#ifdef BSD
+#if defined(BSD) || defined(__FreeBSD_kernel__)
 # ifndef IUCLC
 # define IUCLC 0
 # endif
--- a/tio.h
+++ b/tio.h
@@ -18,7 +18,7 @@
 #if !defined( POSIX_TERMIOS ) && !defined( BSD_SGTTY ) && !defined( SYSV_TERMIO)
 # if defined(linux) || defined(sunos4) || defined(_AIX) || defined(BSD) || \
      defined(SVR4) || defined(solaris2) || defined(m88k) || defined(M_UNIX) ||\
-     defined(__sgi)
+     defined(__sgi) || defined(__GLIBC__)
 #  define POSIX_TERMIOS
 # else
 #  define SYSV_TERMIO
