anyone else have a <sys/stat.h> that DOESN'T #include <sys/types.h> ?

Darren Tucker dtucker at zip.com.au
Thu Feb 5 16:18:09 EST 2004


Lucas Standaert wrote:

> I'm porting openssh 3.7.1p2 to a very BSD 4.4-ish system.   My first
> hint of a problem was that configure said it couldn't find <sys/types.h>
> and that the sizes of char, int, etc were 0 (zero).   It turned
> out that "confdefs.h"

Do you mean config.h not confdefs.h?

 > had HAVE_SYS_STAT_H defined, but not HAVE_SYS_TYPES_H,
> resulting in code such as the following to fail to compile on
> a system where sys/stat.h does NOT include sys/types.h:
> 
> ac_includes_default="\
> #include <stdio.h>
> #if HAVE_SYS_TYPES_H
> # include <sys/types.h>
> #endif
> #if HAVE_SYS_STAT_H
> # include <sys/stat.h>
> #endif

You might also try regenerating configure with autoconf.  Different 
versions of autoconf behave slightly differently on different platforms. 
  OpenSSH currently uses 2.52 with a couple of mods (which is somewhat 
old, but it works properly on most of the platforms we know about).

> I can't figure out where HAVE_SYS_STAT_H gets added to confdefs.h
> by configure, so I worked around the problem by adding this
> flag to the configure invocation:

It's added by the part of configure generated by this fragment of 
configure.ac:

# Checks for header files.
AC_CHECK_HEADERS([...] sys/stat.h [...])

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.




More information about the openssh-unix-dev mailing list