unlock_user(p1, arg1, 0); \
} while (0)
-extern struct iovec *lock_iovec(int type, abi_ulong target_addr, int count,
- int copy);
-extern void unlock_iovec(struct iovec *vec, abi_ulong target_addr, int count,
- int copy);
+struct iovec *lock_iovec(int type, abi_ulong target_addr, int count, int copy);
+void unlock_iovec(struct iovec *vec, abi_ulong target_addr, int count, int copy);
int safe_open(const char *path, int flags, mode_t mode);
int safe_openat(int fd, const char *path, int flags, mode_t mode);
}
/* close(2) */
-static inline abi_long do_bsd_close(abi_long arg1)
+static abi_long do_bsd_close(abi_long arg1)
{
return get_errno(close(arg1));
}
}
if (strcmp(p1, "/proc/curproc/file") == 0) {
CPUState *cpu = env_cpu(env);
- TaskState *ts = (TaskState *)cpu->opaque;
+ TaskState *ts = get_task_state(cpu);
strncpy(p2, ts->bprm->fullpath, arg3);
ret = MIN((abi_long)strlen(ts->bprm->fullpath), arg3);
} else {
return get_errno(fpathconf(arg1, arg2));
}
+/* undelete(2) */
+static abi_long do_bsd_undelete(abi_long arg1)
+{
+ abi_long ret;
+ void *p;
+
+ LOCK_PATH(p, arg1);
+ ret = get_errno(undelete(p)); /* XXX path(p)? */
+ UNLOCK_PATH(p, arg1);
+
+ return ret;
+}
+
#endif /* BSD_FILE_H */