]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/proc_info.h
xnu-1228.0.2.tar.gz
[apple/xnu.git] / bsd / sys / proc_info.h
index 7f8fa65ad9618c9cf159e059b32686e032cda0bb..98bf6d972fd851d33bd8c58276d279be9281c4aa 100644 (file)
@@ -85,6 +85,7 @@ struct proc_bsdinfo {
 #define PROC_FLAG_SLEADER      0x20
 #define PROC_FLAG_CTTY         0x40
 #define PROC_FLAG_CONTROLT     0x80
+#define PROC_FLAG_THCWD                0x100
 
 
 struct proc_taskinfo {
@@ -125,6 +126,7 @@ struct proc_threadinfo {
        int32_t                 pth_curpri;             /* cur priority*/
        int32_t                 pth_priority;           /*  priority*/
        int32_t                 pth_maxpriority;                /* max priority*/
+       char *                  pth_name[64];           /* thread name, if any */
 };
 
 struct proc_regioninfo {
@@ -146,9 +148,9 @@ struct proc_regioninfo {
        uint32_t                pri_private_pages_resident;
        uint32_t                pri_shared_pages_resident;
        uint32_t                pri_obj_id;
+       uint32_t                pri_depth;
        uint64_t                pri_address;
        uint64_t                pri_size;
-       uint32_t                pri_depth;
 };
 
 #define PROC_REGION_SUBMAP     1
@@ -190,11 +192,42 @@ struct proc_fileinfo {
        int32_t                 fi_type;
 };
 
+/* stats flags in proc_fileinfo */
+#define PROC_FP_SHARED 1       /* shared by more than one fd */
+#define PROC_FP_CLEXEC 2       /* close on exec */
+
+/*
+ * A copy of stat64 with static sized fields.
+ */
+struct vinfo_stat {
+       uint32_t        vst_dev;        /* [XSI] ID of device containing file */
+       uint16_t        vst_mode;       /* [XSI] Mode of file (see below) */
+       uint16_t        vst_nlink;      /* [XSI] Number of hard links */
+       uint64_t        vst_ino;        /* [XSI] File serial number */
+       uid_t           vst_uid;        /* [XSI] User ID of the file */
+       gid_t           vst_gid;        /* [XSI] Group ID of the file */
+       int64_t         vst_atime;      /* [XSI] Time of last access */
+       int64_t         vst_atimensec;  /* nsec of last access */
+       int64_t         vst_mtime;      /* [XSI] Last data modification time */
+       int64_t         vst_mtimensec;  /* last data modification nsec */
+       int64_t         vst_ctime;      /* [XSI] Time of last status change */
+       int64_t         vst_ctimensec;  /* nsec of last status change */
+       int64_t         vst_birthtime;  /*  File creation time(birth)  */
+       int64_t         vst_birthtimensec;      /* nsec of File creation time */
+       off_t           vst_size;       /* [XSI] file size, in bytes */
+       int64_t         vst_blocks;     /* [XSI] blocks allocated for file */
+       int32_t         vst_blksize;    /* [XSI] optimal blocksize for I/O */
+       uint32_t        vst_flags;      /* user defined flags for file */
+       uint32_t        vst_gen;        /* file generation number */
+       uint32_t        vst_rdev;       /* [XSI] Device ID */
+       int64_t         vst_qspare[2];  /* RESERVED: DO NOT USE! */
+};
 
 struct vnode_info {
-       struct stat     vi_stat;
-       int             vi_type;
-       fsid_t          vi_fsid;
+       struct vinfo_stat       vi_stat;
+       int                     vi_type;
+       fsid_t                  vi_fsid;
+       int                     vi_pad;
 };
 
 struct vnode_info_path {
@@ -203,17 +236,15 @@ struct vnode_info_path {
 };
 
 struct vnode_fdinfo {
-       struct proc_fileinfo pfi;
+       struct proc_fileinfo    pfi;
        struct vnode_info       pvi;
 };
 
 struct vnode_fdinfowithpath {
        struct proc_fileinfo pfi;
        struct vnode_info_path pvip;
-
 };
 
-
 struct proc_regionwithpathinfo {
        struct proc_regioninfo prp_prinfo;
        struct vnode_info_path prp_vip;
@@ -224,6 +255,10 @@ struct proc_vnodepathinfo {
        struct vnode_info_path pvi_rdir;
 };
 
+struct proc_threadwithpathinfo {
+       struct proc_threadinfo pt;
+       struct vnode_info_path pvip;
+};
 
 /*
  *  Socket 
@@ -429,7 +464,7 @@ struct socket_fdinfo {
 
 
 struct psem_info {
-       struct stat     psem_stat;
+       struct vinfo_stat       psem_stat;
        char                    psem_name[MAXPATHLEN];
 };
 
@@ -441,7 +476,7 @@ struct psem_fdinfo {
 
 
 struct pshm_info  {
-       struct stat             pshm_stat;
+       struct vinfo_stat               pshm_stat;
        uint64_t                pshm_mappaddr;
        char                    pshm_name[MAXPATHLEN];
 };
@@ -453,7 +488,7 @@ struct pshm_fdinfo {
 
 
 struct pipe_info {
-       struct stat pipe_stat;
+       struct vinfo_stat pipe_stat;
        uint64_t        pipe_handle;
        uint64_t        pipe_peerhandle;
        int                     pipe_status;
@@ -466,7 +501,7 @@ struct pipe_fdinfo {
 
 
 struct kqueue_info {
-       struct stat     kq_stat;
+       struct vinfo_stat       kq_stat;
        uint32_t        kq_state;
 };
 #define PROC_KQUEUE_SELECT     1
@@ -478,7 +513,7 @@ struct kqueue_fdinfo {
 };
 
 struct appletalk_info {
-       struct stat     atalk_stat;
+       struct vinfo_stat       atalk_stat;
 };
 
 struct appletalk_fdinfo {
@@ -532,6 +567,13 @@ struct proc_fdinfo {
 #define PROC_PIDVNODEPATHINFO 9
 #define PROC_PIDVNODEPATHINFO_SIZE  (sizeof(struct proc_vnodepathinfo))
 
+#define PROC_PIDTHREADPATHINFO 10
+#define PROC_PIDTHREADPATHINFO_SIZE  (sizeof(struct proc_threadwithpathinfo))
+
+#define PROC_PIDPATHINFO 11
+#define PROC_PIDPATHINFO_SIZE  (MAXPATHLEN)
+#define PROC_PIDPATHINFO_MAXSIZE  (4*MAXPATHLEN)
+
 /* Flavors for proc_pidfdinfo */
 
 #define PROC_PIDFDVNODEINFO 1