Skip to content
Snippets Groups Projects
  1. Mar 28, 2016
  2. Mar 15, 2016
    • Tom Lane's avatar
      Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. · e39f86fe
      Tom Lane authored
      Previously, we included <xlocale.h> only if necessary to get the definition
      of type locale_t.  According to notes in PGAC_TYPE_LOCALE_T, this is
      important because on some versions of glibc that file supplies an
      incompatible declaration of locale_t.  (This info may be obsolete, because
      on my RHEL6 box that seems to be the *only* definition of locale_t; but
      there may still be glibc's in the wild for which it's a live concern.)
      
      It turns out though that on FreeBSD and maybe other BSDen, you can get
      locale_t from stdlib.h or locale.h but mbstowcs_l() and friends only from
      <xlocale.h>.  This was leaving us compiling calls to mbstowcs_l() and
      friends with no visible prototype, which causes a warning and could
      possibly cause actual trouble, since it's not declared to return int.
      
      Hence, adjust the configure checks so that we'll include <xlocale.h>
      either if it's necessary to get type locale_t or if it's necessary to
      get a declaration of mbstowcs_l().
      
      Report and patch by Aleksander Alekseev, somewhat whacked around by me.
      Back-patch to all supported branches, since we have been using
      mbstowcs_l() since 9.1.
      e39f86fe
  3. Feb 08, 2016
  4. Oct 05, 2015
  5. Jun 09, 2015
  6. Jun 01, 2015
  7. May 18, 2015
  8. Feb 02, 2015
  9. Jul 21, 2014
  10. Jun 14, 2014
    • Noah Misch's avatar
      Add mkdtemp() to libpgport. · a919937f
      Noah Misch authored
      This function is pervasive on free software operating systems; import
      NetBSD's implementation.  Back-patch to 8.4, like the commit that will
      harness it.
      a919937f
  11. Mar 17, 2014
  12. Feb 17, 2014
  13. Dec 02, 2013
  14. Oct 08, 2013
  15. Apr 01, 2013
  16. Feb 04, 2013
  17. Dec 03, 2012
  18. Sep 19, 2012
  19. Sep 06, 2012
  20. Aug 31, 2012
    • Tom Lane's avatar
      Make configure probe for mbstowcs_l as well as wcstombs_l. · e4679442
      Tom Lane authored
      We previously supposed that any given platform would supply both or neither
      of these functions, so that one configure test would be sufficient.  It now
      appears that at least on AIX this is not the case ... which is likely an
      AIX bug, but nonetheless we need to cope with it.  So use separate tests.
      Per bug #6758; thanks to Andrew Hastie for doing the followup testing
      needed to confirm what was happening.
      
      Backpatch to 9.1, where we began using these functions.
      e4679442
  21. Aug 24, 2012
  22. Aug 15, 2012
  23. Aug 03, 2012
  24. Jun 01, 2012
  25. May 14, 2012
  26. May 11, 2012
  27. May 07, 2012
  28. Feb 23, 2012
  29. Dec 27, 2011
    • Peter Eisentraut's avatar
      Remove support for on_exit() · d383c23f
      Peter Eisentraut authored
      All supported platforms support the C89 standard function atexit()
      (SunOS 4 probably being the last one not to), and supporting both
      makes the code clumsy.
      d383c23f
  30. Aug 08, 2011
  31. Jun 18, 2011
  32. Jun 17, 2011
  33. Jun 11, 2011
  34. Jun 10, 2011
  35. May 31, 2011
    • Tom Lane's avatar
      Replace use of credential control messages with getsockopt(LOCAL_PEERCRED). · be4585b1
      Tom Lane authored
      It turns out the reason we hadn't found out about the portability issues
      with our credential-control-message code is that almost no modern platforms
      use that code at all; the ones that used to need it now offer getpeereid(),
      which we choose first.  The last holdout was NetBSD, and they added
      getpeereid() as of 5.0.  So far as I can tell, the only live platform on
      which that code was being exercised was Debian/kFreeBSD, ie, FreeBSD kernel
      with Linux userland --- since glibc doesn't provide getpeereid(), we fell
      back to the control message code.  However, the FreeBSD kernel provides a
      LOCAL_PEERCRED socket parameter that's functionally equivalent to Linux's
      SO_PEERCRED.  That is both much simpler to use than control messages, and
      superior because it doesn't require receiving a message from the other end
      at just the right time.
      
      Therefore, add code to use LOCAL_PEERCRED when necessary, and rip out all
      the credential-control-message code in the backend.  (libpq still has such
      code so that it can still talk to pre-9.1 servers ... but eventually we can
      get rid of it there too.)  Clean up related autoconf probes, too.
      
      This means that libpq's requirepeer parameter now works on exactly the same
      platforms where the backend supports peer authentication, so adjust the
      documentation accordingly.
      be4585b1
  36. Apr 27, 2011
  37. Apr 23, 2011
    • Tom Lane's avatar
      Fix char2wchar/wchar2char to support collations properly. · 2ab0796d
      Tom Lane authored
      These functions should take a pg_locale_t, not a collation OID, and should
      call mbstowcs_l/wcstombs_l where available.  Where those functions are not
      available, temporarily select the correct locale with uselocale().
      
      This change removes the bogus assumption that all locales selectable in
      a given database have the same wide-character conversion method; in
      particular, the collate.linux.utf8 regression test now passes with
      LC_CTYPE=C, so long as the database encoding is UTF8.
      
      I decided to move the char2wchar/wchar2char functions out of mbutils.c and
      into pg_locale.c, because they work on wchar_t not pg_wchar_t and thus
      don't really belong with the mbutils.c functions.  Keeping them where they
      were would have required importing pg_locale_t into pg_wchar.h somehow,
      which did not seem like a good plan.
      2ab0796d
  38. Apr 09, 2011
  39. Dec 26, 2010
  40. Nov 23, 2010
Loading