Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19444

Add polyfill for strnlen for systems that lack it

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • Affects Version/s: None
    • Component/s: Internal Code
    • Fully Compatible
    • Build 7 08/10/15, Build 8 08/31/15

      Some systems we target (sometimes) like Solaris 10 don't have strnlen. We should add a configure check and optional polyfill for this function.

      The legacy C++ driver already does this, see:

      https://github.com/mongodb/mongo-cxx-driver/blob/c3242bf85618e5810068b78ecfe26bdfa9bc63ff/SConstruct#L1805

      https://github.com/mongodb/mongo-cxx-driver/blob/c3242bf85618e5810068b78ecfe26bdfa9bc63ff/src/mongo/platform/strnlen.h

      In the server repo, this function should probably live in mongo/stdx/string and be called stdx::strnlen.

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: