home.social

#uapi — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #uapi, aggregated by home.social.

fetched live
  1. TIL on Linux you cannot rely on the timestamps of files in /proc/<pid> to give you information about a process start time: those might be reset on suspend of if a process gets a SIGSTOP.
    Instead, one should look at the 22nd field of /proc/pid/stat: starttime.
    But it gives you the process start time in system clock ticks, not seconds. So you must divide it by sysconf(_SC_CLK_TCK) to get seconds.
    But wait, it gives you the start time in ticks since boot. So you must use clock_gettime(CLOCK_BOOTTIME, ...) to get a usable comparison to the current time.

    Anyway, now progressrm should be more accurate at guessing the file arguments progression (and remaining time) of rm commands.

    #Linux #ProcPid #uapi #JustLinuxThings

  2. TIL on Linux you cannot rely on the timestamps of files in /proc/<pid> to give you information about a process start time: those might be reset on suspend of if a process gets a SIGSTOP.
    Instead, one should look at the 22nd field of /proc/pid/stat: starttime.
    But it gives you the process start time in system clock ticks, not seconds. So you must divide it by sysconf(_SC_CLK_TCK) to get seconds.
    But wait, it gives you the start time in ticks since boot. So you must use clock_gettime(CLOCK_BOOTTIME, ...) to get a usable comparison to the current time.

    Anyway, now progressrm should be more accurate at guessing the file arguments progression (and remaining time) of rm commands.

    #Linux #ProcPid #uapi #JustLinuxThings

  3. I built a tool for image based linux / discoverable disk images:
    github.com/malt3/ddi-tool

    For now, it can update the embedded kernel cmdline of a UKI.
    More features are in the pipeline.

    #systemd #uapi #linux

  4. I built a tool for image based linux / discoverable disk images:
    github.com/malt3/ddi-tool

    For now, it can update the embedded kernel cmdline of a UKI.
    More features are in the pipeline.

    #systemd #uapi #linux

  5. Doing some work on #uapi lately. Interestingly, Django, Flask and Quart set the response `content-type` header to `text/html` by default, even when the status code is 204 and there's no actual response body. Starlette and Aiohttp leave it unset, as expected.

  6. I need to toot the #cattrs and #uapi hashtags so they spring into existence and I can add them to my filters. Will be using them in the future ;)