/* Define to 1 if your system has the F_CLOSEM fcntl. */
#undef HAVE_FCNTL_CLOSEM
+/* Define to 1 if you have the `fgetln' function. */
+#undef HAVE_FGETLN
+
/* Define to 1 if you have the `flock' function. */
#undef HAVE_FLOCK
+
for ac_func in dup2 strchr strrchr memchr memcpy memset sysconf tzset getline \
strftime setrlimit initgroups getgroups fstat gettimeofday \
regcomp setlocale getaddrinfo setsid setenv vhangup nanosleep
+ fgetln
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_FUNC_GETGROUPS
AC_CHECK_FUNCS(dup2 strchr strrchr memchr memcpy memset sysconf tzset getline \
strftime setrlimit initgroups getgroups fstat gettimeofday \
- regcomp setlocale getaddrinfo setsid setenv vhangup nanosleep)
+ regcomp setlocale getaddrinfo setsid setenv vhangup nanosleep
+ fgetln)
AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [
AC_CHECK_LIB(util, openpty, [
AC_CHECK_HEADERS(util.h pty.h, [break])
extern void *erealloc __P((void *, size_t));
+#ifdef HAVE_FGETLN
+ssize_t
+getline(bufp, bufsizep, fp)
+ char **bufp;
+ size_t *bufsizep;
+ FILE *fp;
+{
+ char *buf;
+ size_t bufsize;
+ size_t len;
+
+ buf = fgetln(fp, &len);
+ if (buf) {
+ bufsize = *bufp ? *bufsizep : 0;
+ if (bufsize < len + 1) {
+ bufsize = len + 1;
+ *bufp = erealloc(*bufp, bufsize);
+ *bufsizep = bufsize;
+ }
+ memcpy(*bufp, buf, len);
+ (*bufp)[len] = '\0';
+ }
+ return(buf ? len : -1);
+}
+#else
ssize_t
getline(bufp, bufsizep, fp)
char **bufp;
*bufsizep = bufsize;
return(len);
}
+#endif