Re: SunOS patch for memcmp()

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: SunOS patch for memcmp()
Дата
Msg-id 200112191901.fBJJ1el02925@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: SunOS patch for memcmp()  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
> Bruce Momjian writes:
>
> > > What should we do? The only remaining issue is a non-8-bit-clean
> > > memcmp, which seems pretty easy to fix it.
> >
> > OK, here is a patch to allow SunOS to pass the regression tests.
>
> At a glance, this patch looks okay.  However, since this issue does not
> represent a regression from 7.1 I'm not exactly in favor of installing it
> now.  We want to get a release out, so I think we need to get stricter in
> those matters.  And this patch is not exactly trivial.

I have attached the patch without the autoconf run and without the new
memcmp.c file.  Looks pretty small to me, but I understand.

If we don't want the patch, I will put it on an FTP site somewhere.
However, the configure line numbers changes will be tough to keep
working if a subrelease changes configure.

It seemed worth it to me because it was to enable another port, and I
thought that is what beta was for.  Maybe I can put it in a minor
release.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: configure.in
===================================================================
RCS file: /cvsroot/pgsql/configure.in,v
retrieving revision 1.158
diff -c -r1.158 configure.in
*** configure.in    2001/12/13 22:00:22    1.158
--- configure.in    2001/12/17 19:05:47
***************
*** 809,814 ****
--- 809,817 ----
  AC_FUNC_ACCEPT_ARGTYPES
  PGAC_FUNC_GETTIMEOFDAY_1ARG

+ # SunOS doesn't handle negative byte comparisons properly with +/- return
+ PGAC_FUNC_MEMCMP
+
  AC_CHECK_FUNCS([fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync])

  dnl Check whether <unistd.h> declares fdatasync().
Index: config/c-library.m4
===================================================================
RCS file: /cvsroot/pgsql/config/c-library.m4,v
retrieving revision 1.9
diff -c -r1.9 c-library.m4
*** config/c-library.m4    2001/09/07 19:52:53    1.9
--- config/c-library.m4    2001/12/17 19:05:47
***************
*** 36,41 ****
--- 36,65 ----
  fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG


+ # PGAC_FUNC_MEMCMP
+ # -----------
+ # Check if memcmp() properly handles negative bytes and returns +/-.
+ # SunOS does not.
+ # AC_FUNC_MEMCMP
+ AC_DEFUN(PGAC_FUNC_MEMCMP,
+ [AC_CACHE_CHECK(for 8-bit clean memcmp, pgac_cv_func_memcmp_clean,
+ [AC_TRY_RUN([
+ main()
+ {
+   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+ }
+ ], pgac_cv_func_memcmp_clean=yes, pgac_cv_func_memcmp_clean=no,
+ pgac_cv_func_memcmp_clean=no)])
+ if test $pgac_cv_func_memcmp_clean = no ; then
+   MEMCMP=memcmp.o
+ else
+   MEMCMP=
+ fi
+ AC_SUBST(MEMCMP)dnl
+ ])
+
+
  # PGAC_UNION_SEMUN
  # ----------------
  # Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.
Index: src/Makefile.global.in
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.global.in,v
retrieving revision 1.140
diff -c -r1.140 Makefile.global.in
*** src/Makefile.global.in    2001/10/13 15:24:23    1.140
--- src/Makefile.global.in    2001/12/17 19:05:48
***************
*** 328,333 ****
--- 328,334 ----
  STRERROR = @STRERROR@
  SNPRINTF = @SNPRINTF@
  STRDUP = @STRDUP@
+ MEMCMP = @MEMCMP@
  STRTOUL = @STRTOUL@


Index: src/backend/port/Makefile.in
===================================================================
RCS file: /cvsroot/pgsql/src/backend/port/Makefile.in,v
retrieving revision 1.29
diff -c -r1.29 Makefile.in
*** src/backend/port/Makefile.in    2001/05/08 19:38:57    1.29
--- src/backend/port/Makefile.in    2001/12/17 19:05:48
***************
*** 22,28 ****
  include $(top_builddir)/src/Makefile.global

  OBJS = dynloader.o @INET_ATON@ @STRERROR@ @MISSING_RANDOM@ @SRANDOM@
! OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @STRCASECMP@ @TAS@ @ISINF@
  OBJS+= @STRTOL@ @STRTOUL@ @SNPRINTF@
  ifdef STRDUP
  OBJS += $(top_builddir)/src/utils/strdup.o
--- 22,28 ----
  include $(top_builddir)/src/Makefile.global

  OBJS = dynloader.o @INET_ATON@ @STRERROR@ @MISSING_RANDOM@ @SRANDOM@
! OBJS+= @GETHOSTNAME@ @GETRUSAGE@ @MEMCMP@ @STRCASECMP@ @TAS@ @ISINF@
  OBJS+= @STRTOL@ @STRTOUL@ @SNPRINTF@
  ifdef STRDUP
  OBJS += $(top_builddir)/src/utils/strdup.o

В списке pgsql-patches по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: SunOS patch for memcmp()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SunOS patch for memcmp()