+ return -E_OPEN;
+}
+
+/**
+ * Wrapper for chdir(2).
+ *
+ * \param path the specified directory.
+ *
+ * \return Positive on success, negative on errors.
+ */
+int para_chdir(const char *path)
+{
+ int ret = chdir(path);
+
+ if (ret >= 0)
+ return 1;
+ switch (errno) {
+ case ENOENT:
+ return -E_NOENT;
+ case EACCES:
+ return -E_CHDIR_PERM;
+ };
+ return -E_CHDIR;