Preparation for next commit, where this function will be needed inside libmisc (lib/*). Change-Id: Ibab4f6c09d1e5f0e9cfaea28ae1e7ab5b5c219b5