[SERVER-19444] Add polyfill for strnlen for systems that lack it Created: 16/Jul/15  Updated: 21/Sep/15  Resolved: 27/Aug/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.1.8

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: build-jbr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Build 7 08/10/15, Build 8 08/31/15
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 27/Aug/15 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-19444 Add polyfill for strnlen
Branch: master
https://github.com/mongodb/mongo/commit/e8f3ef4844210a474f24cb5038403917d518f554

Generated at Thu Feb 08 03:51:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.