Apply requirement for gcov automation
[platform/core/system/libstorage.git] / src / storage-common.c
index ba76cc8..fdd3825 100644 (file)
  * limitations under the License.
  */
 
-
+#include <unistd.h>
 #include <libmount.h>
+#include <system_info.h>
 #include "common.h"
 
+#define EXTERNAL_FEATURE        "http://tizen.org/feature/storage.external"
+
 int is_compat_bind_mount(void)
 {
        struct libmnt_table *t = NULL;
@@ -50,3 +53,24 @@ int is_compat_bind_mount(void)
        return 0;
        //LCOV_EXCL_STOP
 }
+
+int storage_ext_is_supported(void)
+{
+       static int support = -1;
+       int ret_val;
+       bool ext_avail;
+
+       if (support >= 0)
+               return support;
+
+       ret_val = system_info_get_platform_bool(EXTERNAL_FEATURE, &ext_avail);
+       if (ret_val < 0)
+               support = 0;
+       else if (ret_val == 0 && !ext_avail)
+               support = 0;
+       else
+               support = 1;
+
+       return support;
+}
+