{
    "mode": "man",
    "parameter": "procps_misc",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/procps_misc/3/json",
    "generated": "2026-10-04T14:35:16Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "procpsmisc - API for miscellaneous information in the /proc filesystem\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <libproc2/misc.h>",
                    "content": "Platform Particulars\n\nlong         procpscpucount (void);\nlong         procpshertzget (void);\nunsigned int procpspidlength (void);\nint          procpslinuxversion (void);\n\nRuntime Particulars\n\nint   procpsloadavg (double *av1, double *av5, double *av15);\nint   procpsuptime (double *uptimesecs, double *idlesecs);\nchar *procpsuptimesprint (void);\nchar *procpsuptimesprintshort (void);\n\nNamespace Particulars\n\nint         procpsnsgetid (const char *name);\nconst char *procpsnsgetname (int id);\nint         procpsnsreadpid (int pid, struct procpsns *nsp);\n\nLink with -lproc2.\n\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "procpscpucount()   returns   the   number   of   CPUs   that   are   currently   online  as\nsysconf(SCNPROCESSORSONLY) or an assumed 1.\n\nprocpshertzget() returns the number of clock ticks per second as sysconf(SCCLKTCK) or an\nassumed 100.  Dividing tics by this value yields seconds.\n\nprocpspidlength() returns the maximum string length for a PID on the system.  For  example,\nif  the  largest  possible  PID  value  on  was  123, then the length would be 3. If the file\n/proc/sys/kernel/pidmax is unreadable, the value is assumed to be 5.\n\nprocpslinuxversion() returns the current Linux version as an encoded integer. On  non-Linux\nsystems  that have an emulated proc filesystem this function returns the version of the Linux\nemulation instead.  The version consists of three positive integers representing  the  major,\nminor and patch levels.  The following macros are provided for encoding a given Linux version\nor separating out the components of the current version.\n\nLINUXVERSION( major , minor , patch )\n\nLINUXVERSIONMAJOR( ver )\n\nLINUXVERSIONMINOR( ver )\n\nLINUXVERSIONPATCH( ver )\n\nprocpsloadavg()  fetches  the  system  load average and puts the 1, 5 and 15 minute averages\ninto location(s) specified by any pointer which is not NULL.\n\nprocpsuptime() returns uptime and/or idle seconds into location(s) specified by any  pointer\nwhich is not NULL.  The sprint varieties return a human-readable string in one of two forms.\n\nHH:MM:SS up HH:MM, # users, load average: 1, 5, 15 MM averages\n\nup HH, MM\n\nprocpsnsgetid()  returns  the  integer  id  (enum namespacetype) of the namespace for the\ngiven namespace name.\n\nprocpsnsgetname()  returns  the  name  of  the  namespace   for   the   given   id   (enum\nnamespacetype).\n\nprocpsnsreadpid()  returns  the  inodes  for  the  namespaces  of the given process in the\nprocpsns structure pointed to by nsp.  Those inodes will appear in the order  proscribed  by\nenum namespacetype.\n\nenum namespacetype {\nPROCPSNSCGROUP,\nPROCPSNSIPC,\nPROCPSNSMNT,\nPROCPSNSNET,\nPROCPSNSPID,\nPROCPSNSTIME,\nPROCPSNSUSER,\nPROCPSNSUTS\n};\n\n\n",
            "subsections": []
        },
        "RETURN VALUE": {
            "content": "",
            "subsections": [
                {
                    "name": "Functions Returning an `int' or `long'",
                    "content": "An error will be indicated by a negative number that is always the inverse of some well known\nerrno.h value.\n\n"
                },
                {
                    "name": "Functions Returning an `address'",
                    "content": "An error will be indicated by a NULL return pointer with the reason found in the formal errno\nvalue.\n\n"
                }
            ]
        },
        "FILES": {
            "content": "/proc/loadavg\nThe raw values for load average.\n\n/proc/sys/kernel/osrelease\nContains the release version of the Linux kernel or proc filesystem.\n\n/proc/sys/kernel/pidmax\nContains the value at which PIDs wrap around, one greater than the maximum PID value.\n\n/proc/uptime\nThe raw values for uptime and idle time.\n\n/proc/<PID>/ns\ncontains the set of namespaces for a particular PID.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "procps(3), procpspids(3), proc(5).\n\nlibproc2                                     August 2022                              PROCPSMISC(3)",
            "subsections": []
        }
    },
    "summary": "procpsmisc - API for miscellaneous information in the /proc filesystem",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "procps",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/procps/3/json"
        },
        {
            "name": "procpspids",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/procpspids/3/json"
        },
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ]
}