]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/proc.h
xnu-1228.tar.gz
[apple/xnu.git] / bsd / sys / proc.h
index 6411239bc072a4d66b223f0b431e6683415f8d7e..9d41f7ca7b9b6531fe7d102de77536dbaadcbd36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -159,7 +159,7 @@ struct extern_proc {
 #define        SSTOP   4               /* Process debugging or suspension. */
 #define        SZOMB   5               /* Awaiting collection by parent. */
 
-/* These flags are kept in p_flags. */
+/* These flags are kept in extern_proc.p_flag. */
 #define        P_ADVLOCK       0x00000001      /* Process may hold POSIX adv. lock */
 #define        P_CONTROLT      0x00000002      /* Has a controlling terminal */
 #define        P_LP64          0x00000004      /* Process is LP64 */
@@ -175,32 +175,33 @@ struct extern_proc {
 #define        P_TIMEOUT       0x00000400      /* Timing out during sleep */
 #define        P_TRACED        0x00000800      /* Debugged process being traced */
 
-#define        P_WAITED        0x00001000      /* Debugging prc has waited for child */
-#define        P_WEXIT         0x00002000      /* Working on exiting. */
+#define        P_RESV3         0x00001000      /* (P_WAITED)Debugging prc has waited for child */
+#define        P_WEXIT         0x00002000      /* Working on exiting */
 #define        P_EXEC          0x00004000      /* Process called exec. */
 
 /* Should be moved to machine-dependent areas. */
 #define        P_OWEUPC        0x00008000      /* Owe process an addupc() call at next ast. */
 
 #define        P_AFFINITY      0x00010000      /* xxx */
-#define        P_CLASSIC       0x00020000      /* xxx */
+#define        P_TRANSLATED    0x00020000      /* xxx */
+#define        P_CLASSIC       P_TRANSLATED    /* xxx */
 /*
 #define        P_FSTRACE       0x10000 / * tracing via file system (elsewhere?) * /
 #define        P_SSTEP         0x20000 / * process needs single-step fixup ??? * /
 */
 
-#define        P_WAITING       0x00040000      /* process has a wait() in progress */
-#define        P_KDEBUG        0x00080000      /* kdebug tracing on for this process */
+#define        P_RESV5         0x00040000      /* (P_WAITING) process has a wait() in progress */
+#define        P_CHECKOPENEVT  0x00080000      /* check if a vnode has the OPENEVT flag set on open */
 
-#define        P_TTYSLEEP      0x00100000      /* blocked due to SIGTTOU or SIGTTIN */
+#define        P_DEPENDENCY_CAPABLE    0x00100000      /* process is ok to call vfs_markdependency() */
 #define        P_REBOOT        0x00200000      /* Process called reboot() */
 #define        P_TBE           0x00400000      /* Process is TBE */
-#define        P_SIGEXC        0x00800000      /* signal exceptions */
+#define        P_RESV7         0x00800000      /* (P_SIGEXC)signal exceptions */
 
-#define        P_BTRACE        0x01000000      /* process is being branch traced */
-#define        P_VFORK         0x02000000      /* process has vfork children */
-#define        P_NOATTACH      0x04000000
-#define        P_INVFORK       0x08000000      /* proc in vfork */
+#define        P_THCWD         0x01000000      /* process has thread cwd  */
+#define        P_RESV9         0x02000000      /* (P_VFORK)process has vfork children */
+#define        P_RESV10        0x04000000      /* used to be P_NOATTACH */
+#define        P_RESV11        0x08000000      /* (P_INVFORK) proc in vfork */
 
 #define        P_NOSHLIB       0x10000000      /* no shared libs are in use for proc */
                                        /* flag set on exec */
@@ -221,11 +222,11 @@ __BEGIN_DECLS
 
 extern proc_t kernproc;
 
-extern int proc_is_classic(struct proc *p);
-struct proc *current_proc_EXTERNAL(void);
+extern int proc_is_classic(proc_t p);
+proc_t current_proc_EXTERNAL(void);
 
 extern int     msleep(void *chan, lck_mtx_t *mtx, int pri, const char *wmesg, struct timespec * ts );
-extern void    unsleep(struct proc *);
+extern void    unsleep(proc_t);
 extern void    wakeup(void *chan);
 extern void wakeup_one(caddr_t chan);
 
@@ -267,17 +268,24 @@ extern int proc_forcequota(proc_t);
 extern int proc_is64bit(proc_t);
 /* is this process exiting? */
 extern int proc_exiting(proc_t);
-/* this routine returns error is the process is not one with super user privileges */
-int proc_suser(struct proc *p);
-/* returns the ucred assicaited with the process; temporary api */
-struct ucred * proc_ucred(struct proc *p);
+/* this routine returns error if the process is not one with super user privileges */
+int proc_suser(proc_t p);
+/* returns the cred assicaited with the process; temporary api */
+kauth_cred_t proc_ucred(proc_t p);
+#ifdef __APPLE_API_UNSTABLE
+/* returns the first thread_t in the process, or NULL XXX for NFS, DO NOT USE */
+thread_t proc_thread(proc_t);
+#endif
+// mark a process as being allowed to call vfs_markdependency()
+void bsd_set_dependency_capable(task_t task);
+
+extern int proc_pendingsignals(proc_t, sigset_t);
+extern int proc_tbe(proc_t);
 
+#ifdef KERNEL_PRIVATE
 /* LP64todo - figure out how to identify 64-bit processes if NULL procp */
 extern int IS_64BIT_PROCESS(proc_t);
-extern int proc_pendingsignals(struct proc *, sigset_t);
-extern int proc_tbe(struct proc *);
 
-#ifdef KERNEL_PRIVATE
 extern int     tsleep(void *chan, int pri, const char *wmesg, int timo);
 extern int     msleep1(void *chan, lck_mtx_t *mtx, int pri, const char *wmesg, u_int64_t timo);
 #endif