Build error on HP-UX
Rick Jones
rick.jones2 at hp.com
Fri Jun 20 10:05:28 EST 2003
Ben Lindstrom wrote:
>
> On Thu, 19 Jun 2003, Rick Jones wrote:
>
> > Ben Lindstrom wrote:
> > >
> > > How does HP/UX define utimes?
> >
> > Thusly on 11.0:
> >
> >
> > utimes(2)
> > utimes(2)
> >
> > NAME
> > utimes - set file access and modification times
> >
> > SYNOPSIS
> > #include <sys/time.h>
> >
> > int utimes(const char *path, const struct timeval times[2]);
> >
>
> Interesting enough Linux and OpenBSD at least deinfe it *times instead of
> times[2], but the code itself should be fine.
I wonder what Posix/X/Open say about it, if anything.
> It bothers me that configure.ac generated the wrong check. What library
> is utimes() part of?
I'm guessing it is part of libc:
$ nm /usr/lib/libc.sl | grep utimes
_utimes | 739636|extern|code |$CODE$
utimes | 739596|extern|entry |
utimes | 739636|extern|code |$CODE$
> Maybe we need additional check besides:
>
> AC_CHECK_FUNC(utimes,
> [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
> LIBS="$LIBS -lc89"]) ]
> )
Likely - if I try to compile my foo.c with a -lc89:
$ cc foo.c -lc89
/usr/ccs/bin/ld: Can't find library: "c89"
which could I suppose make configure think there is no utimes on UX...
perhaps it should try first without the -lc89 and only try it if the
first one fails?
> [..]
> > > bsd-misc.c:int utimes(char *filename, struct timeval *tvp)
> > > bsd-misc.h:int utimes(char *, struct timeval *);
> > >
> > > Try in the bsd-misc.h changing it to be exactly as it's defined in the
> > > bsd-misc.c. Maybe your compiler is picky.
> >
> > Perhaps the use of const in the UX headers is the trigger for this?
> >
> No it is because the second argument is different (*tvp vs tvp[2])
Thanks - I confirmed it by changing the timeval to an int and dropping
the sys/time/h include and seeing that it compiled just fine.
> I'd say something is wrong with configure.ac script. If you go into
> config.h and uncomment "#define HAVE_UTIMES 1" and compile does HP/UX 11
> work correctly?
I'll have to let the original reporter report on that.
rick
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com but NOT BOTH...
More information about the openssh-unix-dev
mailing list