+static int
+kpersona_getpath_syscall(user_addr_t idp, user_addr_t path)
+{
+ int error;
+ uid_t persona_id;
+ struct persona *persona;
+ size_t pathlen;
+ uid_t current_persona_id = PERSONA_ID_NONE;
+
+ if (!path) {
+ return EINVAL;
+ }
+
+ error = copyin(idp, &persona_id, sizeof(persona_id));
+ if (error) {
+ return error;
+ }
+
+ /* Get current thread's persona id to compare if the
+ * input persona_id matches the current persona id
+ */
+ persona = current_persona_get();
+ if (persona) {
+ current_persona_id = persona->pna_id;
+ }
+
+ if (persona_id && persona_id != current_persona_id) {
+ /* Release the reference on the current persona id's persona */
+ persona_put(persona);
+ if (!kauth_cred_issuser(kauth_cred_get()) &&
+ !IOTaskHasEntitlement(current_task(), PERSONA_MGMT_ENTITLEMENT)) {
+ return EPERM;
+ }
+ persona = persona_lookup(persona_id);
+ }
+
+ if (!persona) {
+ return ESRCH;
+ }
+
+ if (persona->pna_path) {
+ error = copyoutstr((void *)persona->pna_path, path, MAXPATHLEN, &pathlen);
+ }
+
+ persona_put(persona);
+
+ return error;
+}
+
+static int
+kpersona_info_syscall(user_addr_t idp, user_addr_t infop)