3 ms·
Summary of the article if you omit the trace itself: >> macOS `cp` (*nix not discussed) copies files (somehow, not discussed). Then, via macOS-specific syscall
by developer2 8y ago
Summary of the article if you omit the trace itself:
>> macOS `cp` (*nix not discussed) copies files (somehow, not discussed). Then, via macOS-specific syscalls, file attributes/metadata are manipulated (details superficially discussed).
The core functionality of `cp` - namely, copying a file - is not discussed at all; only the pasted trace gives any insight. There are naive ways one could do so, such as opening the source for read and destination for write and iterating X bytes/pages at a time in user space, versus mapping files to memory, versus instructing the kernel to perform a direct low-level copy. I was expecting such an analysis, and perhaps an idea of how things change depending on whether the source and destination paths exist on the same filesystem.
Instead, the only talking points refer to macOS-specific extensions. References are made to system integrity protection (SIP), flistxattr for setting attributes, and MAC policies. Yet all we get are descriptions as to what those subsystems are, without any explanation as to why `cp` is calling into them. I would assume it's simply to copy file attributes from sources to destinations (duh), but whether this is the case is not covered.
- ktpsns 8y agoFunny thing is that MAC does not stand for Macintosh but for Mandatory Access Control, source: https://www.freebsd.org/doc/en/books/arch-handbook/mac-background.html https://www.freebsd.org/doc/en/books/arch-handbook/mac-backg...