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?
cat isn’t the one writing to the drive there.
It actually is. The file gets opened by bash and bash passes the file descriptor to
cat
butcat
is the program which instructs the kernel to write to the device.Modern
cat
even does reflink copies on supported filesystems.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.
You just proved my own point.
cat
does thewrite()
. Bash just configures where it writes to.No, I was specifically thinking of
cat
. I just copied a 73G non-sparse incompressible file in 3 seconds usingcat file > copy
.copy_file_range
does reflinks on btrfs.