Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section


 703              uid_t pr_uid;            /* real user id */
 704              uid_t pr_euid;           /* effective user id */
 705              gid_t pr_gid;            /* real group id */
 706              gid_t pr_egid;           /* effective group id */
 707              uintptr_t pr_addr;       /* address of process */
 708              size_t pr_size;          /* size of process image in Kbytes */
 709              size_t pr_rssize;        /* resident set size in Kbytes */
 710              dev_t pr_ttydev;         /* controlling tty device (or PRNODEV) */
 711              ushort_t pr_pctcpu;      /* % of recent cpu time used by all lwps */
 712              ushort_t pr_pctmem;      /* % of system memory used by process */
 713              timestruc_t pr_start;    /* process start time, from the epoch */
 714              timestruc_t pr_time;     /* cpu time for this process */
 715              timestruc_t pr_ctime;    /* cpu time for reaped children */
 716              char pr_fname[PRFNSZ];   /* name of exec'ed file */
 717              char pr_psargs[PRARGSZ]; /* initial characters of arg list */
 718              int pr_wstat;            /* if zombie, the wait() status */
 719              int pr_argc;             /* initial argument count */
 720              uintptr_t pr_argv;       /* address of initial argument vector */
 721              uintptr_t pr_envp;       /* address of initial environment vector */
 722              char pr_dmodel;          /* data model of the process */
 723              lwpsinfo_t pr_lwp;       /* information for representative lwp */
 724              taskid_t pr_taskid;      /* task id */
 725              projid_t pr_projid;      /* project id */
 726              poolid_t pr_poolid;      /* pool id */
 727              zoneid_t pr_zoneid;      /* zone id */
 728              ctid_t pr_contract;      /* process contract id */

 729          } psinfo_t;
 730 
 731 
 732 
 733        Some of the entries in psinfo, such as pr_addr, refer to internal
 734        kernel data structures and should not be expected to retain their
 735        meanings across different versions of the operating system.
 736 
 737 
 738        psinfo_t.pr_flag is a deprecated interface that should no longer be
 739        used.  Applications currently relying on the SSYS bit in pr_flag should
 740        migrate to checking PR_ISSYS in the pstatus structure's pr_flags field.
 741 
 742 
 743        pr_pctcpu and pr_pctmem are 16-bit binary fractions in the range 0.0 to
 744        1.0 with the binary point to the right of the high-order bit (1.0 ==
 745        0x8000). pr_pctcpu is the summation over all lwps in the process.
 746 
 747 
 748        pr_lwp contains the ps(1) information for the representative lwp.  If


1210        lwps (lwps that once existed but no longer exist in the process).
1211        Excluding the pr_lwpid, pr_tstamp, pr_create, and pr_term entries, the
1212        entry-by-entry summation over all these structures is the definition of
1213        the process usage information obtained from the usage file. (See also
1214        /proc/pid/lwp/lwpid/lwpusage, below.)
1215 
1216    lwp
1217        A directory containing entries each of which names an active or zombie
1218        lwp within the process. These entries are themselves directories
1219        containing additional files as described below. Only the lwpsinfo file
1220        exists in the directory of a zombie lwp.
1221 
1222 STRUCTURE OF /proc/pid/lwp/lwpid
1223        A given directory /proc/pid/lwp/lwpid contains the following entries:
1224 
1225    lwpctl
1226        Write-only control file. The messages written to this file affect the
1227        specific lwp rather than the representative lwp, as is the case for the
1228        process's ctl file.
1229 










1230    lwpstatus
1231        lwp-specific state information. This file contains the lwpstatus
1232        structure for the specific lwp as described above for the
1233        representative lwp in the process's status file.
1234 
1235    lwpsinfo
1236        lwp-specific ps(1) information. This file contains the lwpsinfo
1237        structure for the specific lwp as described above for the
1238        representative lwp in the process's psinfo file. The lwpsinfo file
1239        remains accessible after an lwp becomes a zombie.
1240 
1241    lwpusage
1242        This file contains the prusage structure for the specific lwp as
1243        described above for the process's usage file.
1244 
1245    gwindows
1246        This file exists only on SPARC based machines. If it is non-empty, it
1247        contains a gwindows_t structure, defined in <sys/regset.h>, with   the
1248        values of those SPARC register windows that could not be stored on the
1249        stack when the lwp stopped. Conditions under which register windows are


2320        elements out of order for descriptive clarity. The actual structure
2321        definitions are contained in <procfs.h>.
2322 
2323 BUGS
2324        Because the old ioctl(2)-based version of /proc is currently supported
2325        for binary compatibility with old applications, the top-level directory
2326        for a process, /proc/pid, is not world-readable, but it is world-
2327        searchable. Thus, anyone can open /proc/pid/psinfo even though ls(1)
2328        applied to /proc/pid will fail for anyone but the owner or an
2329        appropriately privileged process. Support for the old ioctl(2)-based
2330        version of /proc will be dropped in a future release, at which time the
2331        top-level directory for a process will be made world-readable.
2332 
2333 
2334        On SPARC based machines, the types gregset_t and fpregset_t defined in
2335        <sys/regset.h> are similar to but not the same as the types prgregset_t
2336        and prfpregset_t defined in <procfs.h>.
2337 
2338 
2339 
2340                                  June 6, 2016                          PROC(4)


 703              uid_t pr_uid;            /* real user id */
 704              uid_t pr_euid;           /* effective user id */
 705              gid_t pr_gid;            /* real group id */
 706              gid_t pr_egid;           /* effective group id */
 707              uintptr_t pr_addr;       /* address of process */
 708              size_t pr_size;          /* size of process image in Kbytes */
 709              size_t pr_rssize;        /* resident set size in Kbytes */
 710              dev_t pr_ttydev;         /* controlling tty device (or PRNODEV) */
 711              ushort_t pr_pctcpu;      /* % of recent cpu time used by all lwps */
 712              ushort_t pr_pctmem;      /* % of system memory used by process */
 713              timestruc_t pr_start;    /* process start time, from the epoch */
 714              timestruc_t pr_time;     /* cpu time for this process */
 715              timestruc_t pr_ctime;    /* cpu time for reaped children */
 716              char pr_fname[PRFNSZ];   /* name of exec'ed file */
 717              char pr_psargs[PRARGSZ]; /* initial characters of arg list */
 718              int pr_wstat;            /* if zombie, the wait() status */
 719              int pr_argc;             /* initial argument count */
 720              uintptr_t pr_argv;       /* address of initial argument vector */
 721              uintptr_t pr_envp;       /* address of initial environment vector */
 722              char pr_dmodel;          /* data model of the process */

 723              taskid_t pr_taskid;      /* task id */
 724              projid_t pr_projid;      /* project id */
 725              poolid_t pr_poolid;      /* pool id */
 726              zoneid_t pr_zoneid;      /* zone id */
 727              ctid_t pr_contract;      /* process contract id */
 728              lwpsinfo_t pr_lwp;       /* information for representative lwp */
 729          } psinfo_t;
 730 
 731 
 732 
 733        Some of the entries in psinfo, such as pr_addr, refer to internal
 734        kernel data structures and should not be expected to retain their
 735        meanings across different versions of the operating system.
 736 
 737 
 738        psinfo_t.pr_flag is a deprecated interface that should no longer be
 739        used.  Applications currently relying on the SSYS bit in pr_flag should
 740        migrate to checking PR_ISSYS in the pstatus structure's pr_flags field.
 741 
 742 
 743        pr_pctcpu and pr_pctmem are 16-bit binary fractions in the range 0.0 to
 744        1.0 with the binary point to the right of the high-order bit (1.0 ==
 745        0x8000). pr_pctcpu is the summation over all lwps in the process.
 746 
 747 
 748        pr_lwp contains the ps(1) information for the representative lwp.  If


1210        lwps (lwps that once existed but no longer exist in the process).
1211        Excluding the pr_lwpid, pr_tstamp, pr_create, and pr_term entries, the
1212        entry-by-entry summation over all these structures is the definition of
1213        the process usage information obtained from the usage file. (See also
1214        /proc/pid/lwp/lwpid/lwpusage, below.)
1215 
1216    lwp
1217        A directory containing entries each of which names an active or zombie
1218        lwp within the process. These entries are themselves directories
1219        containing additional files as described below. Only the lwpsinfo file
1220        exists in the directory of a zombie lwp.
1221 
1222 STRUCTURE OF /proc/pid/lwp/lwpid
1223        A given directory /proc/pid/lwp/lwpid contains the following entries:
1224 
1225    lwpctl
1226        Write-only control file. The messages written to this file affect the
1227        specific lwp rather than the representative lwp, as is the case for the
1228        process's ctl file.
1229 
1230    lwpname
1231        A buffer of THREAD_NAME_MAX bytes representing the LWP name; the buffer
1232        is zero-filled if the thread name is shorter than the buffer. If no
1233        thread name is set, the buffer contains the empty string. A read with a
1234        buffer shorter than THREAD_NAME_MAX bytes is not guaranteed to be NUL-
1235        terminated.  Writing to this file will set the LWP name for the
1236        specific lwp.  This file may not be present in older operating system
1237        versions. THREAD_NAME_MAX may increase in the future; clients should be
1238        prepared for this.
1239 
1240    lwpstatus
1241        lwp-specific state information. This file contains the lwpstatus
1242        structure for the specific lwp as described above for the
1243        representative lwp in the process's status file.
1244 
1245    lwpsinfo
1246        lwp-specific ps(1) information. This file contains the lwpsinfo
1247        structure for the specific lwp as described above for the
1248        representative lwp in the process's psinfo file. The lwpsinfo file
1249        remains accessible after an lwp becomes a zombie.
1250 
1251    lwpusage
1252        This file contains the prusage structure for the specific lwp as
1253        described above for the process's usage file.
1254 
1255    gwindows
1256        This file exists only on SPARC based machines. If it is non-empty, it
1257        contains a gwindows_t structure, defined in <sys/regset.h>, with   the
1258        values of those SPARC register windows that could not be stored on the
1259        stack when the lwp stopped. Conditions under which register windows are


2330        elements out of order for descriptive clarity. The actual structure
2331        definitions are contained in <procfs.h>.
2332 
2333 BUGS
2334        Because the old ioctl(2)-based version of /proc is currently supported
2335        for binary compatibility with old applications, the top-level directory
2336        for a process, /proc/pid, is not world-readable, but it is world-
2337        searchable. Thus, anyone can open /proc/pid/psinfo even though ls(1)
2338        applied to /proc/pid will fail for anyone but the owner or an
2339        appropriately privileged process. Support for the old ioctl(2)-based
2340        version of /proc will be dropped in a future release, at which time the
2341        top-level directory for a process will be made world-readable.
2342 
2343 
2344        On SPARC based machines, the types gregset_t and fpregset_t defined in
2345        <sys/regset.h> are similar to but not the same as the types prgregset_t
2346        and prfpregset_t defined in <procfs.h>.
2347 
2348 
2349 
2350                                 August 22, 2018                        PROC(4)