+ * Opens 'filename' after search.
+ *
+ * Returns the file descriptor as returned by openat
+ * system call or -1 in case of error.
+ */
+int locale_search_open(struct locale_search *search, const char *filename, int flags)
+{
+ return do_open(search, filename, flags, search->root);
+}
+
+/*
+ * Opens 'filename' for root with default search.
+ *
+ * Returns the file descriptor as returned by openat
+ * system call or -1 in case of error.
+ */
+int locale_root_open(struct locale_root *root, const char *filename, int flags, const char *locale)
+{
+ int result;
+ struct locale_search *search;
+
+ search = locale != NULL ? locale_root_search(root, locale, 0) : NULL;
+ result = do_open(search ? : root->default_search, filename, flags, root);
+ locale_search_unref(search);
+ return result;
+}
+
+/*
+ * Resolves 'filename' for 'root' and 'search'.