I’m planning to move over to Guix over NixOS, as soon as my current situation improves and possibly import a new libre respecting laptop (Star Labs is thankfully available in India). I do have a very old laptop with a Celeron processor and 4GB of RAM with Guix installed already, and what has come to my attention is that it uses shepherd.

I’m not actually against or for systemd, in fact, I am not really sure why I should even care - maybe it is because I’m still not on to the level of a power user. Since I’m starting to learn kernel basics to prepare for GNU/Hurd contributions in the nearest possible future and shepherd seems to be what the GNU folks will be using, is there any reason why I should even care about the freedom of init system?

  • vrighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 year ago

    cat is writing to a file descriptor. Which is pretty much transparent to it. it’s just sometimes redirected. What happens when cat writes to it is not up to cat. In fact, I looked at the source of coreutils. there are two sub implementations of cat. copy_cat, which uses copy_file_range when the input and output are a regular file, and simple_cat which does a simple read/write loop. In both cases the target file descriptor is STDOUT_FILENO. So the target file descriptor is hardcoded to 1. Cat is not aware of where the data is coming from, or where it’s going. It is hardcoded to only ever write to stdout.

    edit: re the reflink thing, you were probably thinking of cp, not cat.

    • Atemu@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      simple_cat which does a simple read/write loop

      You just proved my own point. cat does the write(). Bash just configures where it writes to.

      re the reflink thing, you were probably thinking of cp, not cat.

      No, I was specifically thinking of cat. I just copied a 73G non-sparse incompressible file in 3 seconds using cat file > copy.

      copy_file_range does reflinks on btrfs.