Hello, I've got the same problem like this one. Can somebody send the snprintf.c or other ways around please? Thanks, <------- snipped from mail archive ----------------------------------> I just email'd, from my other account, the snprintf.c that we distribute in PostgreSQL...its been thoroughly tested on all the platforms that we support, with Solaris 2.5.1 being one of them...the bsd-snprintf.c that we included in OpenSSH, I believe, was the stock FreeBSD one, whereas this one is meant to be generic ... I *believe* that we pulled/borrowed this from sendmail originally... <------------------ end snip ----------------------------------------> bsd-snprintf.c: In function `msetup': bsd-snprintf.c:86: warning: implicit declaration of function `getpagesize' bsd-snprintf.c:91: `x' undeclared (first use this function) bsd-snprintf.c:91: (Each undeclared identifier is reported only once bsd-snprintf.c:91: for each function it appears in.) bsd-snprintf.c:91: `y' undeclared (first use this function) bsd-snprintf.c:91: warning: left-hand operand of comma expression has no effect bsd-snprintf.c: In function `vsnprintf': bsd-snprintf.c:133: warning: variable `ret' might be clobbered by `longjmp' or `vfork' bsd-snprintf.c: At top level: bsd-snprintf.c:52: warning: `caught' defined but not used make: *** [bsd-snprintf.o] Error 1 -- Aris Mulyono
On Wed, 12 Jan 2000, Aris Mulyono wrote:> Hello, > > > I've got the same problem like this one. > Can somebody send the snprintf.c or other ways around please? >Due a bug in Solaris I was tracking in 2.5 and 2.5.1, it turns out there is an snprintf in solaris' libc, and I will do what I can to post a patch so we don't have to use an outside source. Ben> Thanks, > > <------- snipped from mail archive ----------------------------------> > I just email'd, from my other account, the snprintf.c that we distribute > in PostgreSQL...its been thoroughly tested on all the platforms that we > support, with Solaris 2.5.1 being one of them...the bsd-snprintf.c that we > included in OpenSSH, I believe, was the stock FreeBSD one, whereas this > one is meant to be generic ... > > I *believe* that we pulled/borrowed this from sendmail originally... > > <------------------ end snip ----------------------------------------> > > bsd-snprintf.c: In function `msetup': > bsd-snprintf.c:86: warning: implicit declaration of function `getpagesize' > bsd-snprintf.c:91: `x' undeclared (first use this function) > bsd-snprintf.c:91: (Each undeclared identifier is reported only once > bsd-snprintf.c:91: for each function it appears in.) > bsd-snprintf.c:91: `y' undeclared (first use this function) > bsd-snprintf.c:91: warning: left-hand operand of comma expression has no effect > bsd-snprintf.c: In function `vsnprintf': > bsd-snprintf.c:133: warning: variable `ret' might be clobbered by `longjmp' or > `vfork' > bsd-snprintf.c: At top level: > bsd-snprintf.c:52: warning: `caught' defined but not used > make: *** [bsd-snprintf.o] Error 1 > > -- > Aris Mulyono >
On Wed, 12 Jan 2000, Aris Mulyono wrote:> Hello, > > > I've got the same problem like this one. > Can somebody send the snprintf.c or other ways around please?This is a snippet of code an engineer at Sun sent me when they were confused about some code which couldn't find snprintf under 2.5/2.5.1. It looks like all we have to do for 2.5/2.5.1 support is define #define snprintf __snprintf #define vsnprintf __vsnprintf I will check my 2.5.1 system tommorow and see what I can do about patching. (Anyone got a snippet of Autoconf to test various versions of a particular Operating system) Let me know if this fixes the 2.5/2.5.1 problem Thanks Ben ------ /* * If compiled and linked on OS 5.5.1 or earlier works on 5.5 or later. * to compile on 5.6 or later and work on 5.5.1 or earlire, * reverse __snprintf and snprintf at indicated lines. * If compiled on 5.6 or later without reversing, it will work on 5.6 or * later but not 5.5.1 or earlier. * For OS 5.4 or earlier you need libc patch. If not it will core dump; */ int snprintf(char *, size_t, const char *, ...); #pragma weak snprintf int __snprintf(char *, size_t, const char *, ...); #pragma weak __snprintf /* to compile on 5.6 or later and work on 5.5 or earlier use __snprintf here */ int (*snprintf_p)(char *, size_t, const char *, ...) = snprintf; #define snprintf snprintf_p main() { char buf[100]; if (snprintf_p == NULL) { /* to compile on 5.6 or later and work on 5.5 or earlier use snprintf here */ snprintf_p = __snprintf; }> > Thanks, > > <------- snipped from mail archive ----------------------------------> > I just email'd, from my other account, the snprintf.c that we distribute > in PostgreSQL...its been thoroughly tested on all the platforms that we > support, with Solaris 2.5.1 being one of them...the bsd-snprintf.c that we > included in OpenSSH, I believe, was the stock FreeBSD one, whereas this > one is meant to be generic ... > > I *believe* that we pulled/borrowed this from sendmail originally... > > <------------------ end snip ----------------------------------------> > > bsd-snprintf.c: In function `msetup': > bsd-snprintf.c:86: warning: implicit declaration of function `getpagesize' > bsd-snprintf.c:91: `x' undeclared (first use this function) > bsd-snprintf.c:91: (Each undeclared identifier is reported only once > bsd-snprintf.c:91: for each function it appears in.) > bsd-snprintf.c:91: `y' undeclared (first use this function) > bsd-snprintf.c:91: warning: left-hand operand of comma expression has no effect > bsd-snprintf.c: In function `vsnprintf': > bsd-snprintf.c:133: warning: variable `ret' might be clobbered by `longjmp' or > `vfork' > bsd-snprintf.c: At top level: > bsd-snprintf.c:52: warning: `caught' defined but not used > make: *** [bsd-snprintf.o] Error 1 > > -- > Aris Mulyono >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 12 Jan 2000, Ben Taylor wrote:> It looks like all we have to do for 2.5/2.5.1 support is define > #define snprintf __snprintf > #define vsnprintf __vsnprintfI will integrate tests for the __ functions into configure.in Damien - -- | "Bombay is 250ms from New York in the new world order" - Alan Cox | Damien Miller - http://www.mindrot.org/ | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.0 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE4fVPhormJ9RG1dI8RAihNAJ9elTgwb29mgVq0V3U2sskDmmwA4wCgqn6x h1vzZMKTygjIeBceIE90B1I=7SFO -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 12 Jan 2000, Ben Taylor wrote:> It looks like all we have to do for 2.5/2.5.1 support is define > #define snprintf __snprintf > #define vsnprintf __vsnprintfDone. Regards, Damien - -- | "Bombay is 250ms from New York in the new world order" - Alan Cox | Damien Miller - http://www.mindrot.org/ | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.0 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE4gQluormJ9RG1dI8RAgl3AKCvoukXc5ec7mbKFcvVMcfg9UN9+ACgz0C7 hoh9VPnqGcxOMn9ofPoxr+E=W/9g -----END PGP SIGNATURE-----