News for hackers. Stuff that matters.
Re:Mkfile(8) is severely syscall limited on OS X by throwawayish on Sunday February 12, 2017 @07:53AM (#13628107)
No, mkfile creates a file with written extents (no sparse or uninitialized areas), while fallocate will (with ext4/xfs/...) only map some extents which are marked uninitialized. So while mkfile 10G would have to write ~10 GB of data, fallocate 10G is nearly instanteneous, because it most likely just allocated a single extent.

xfs_mkfile could do what mkfile does, the description isn't conclusive enough.

Re:Mkfile(8) is severely syscall limited on OS X by gcr on Sunday February 12, 2017 @08:06AM (#13628150)
You can use good old `dd` for this:

    dd if=/dev/zero of=test bs=1k seek=2m count=1
Or python:

    python -c 'f=open("test", "w"); f.seek(2e9); f.write("\x00")'
Both these calls create a ~2GB file with holes in it. They return almost instantly on OSX.

EDIT: oh wait, this isn't what you want. you want a file _without_ holes, my mistake.

Re:Mkfile(8) is severely syscall limited on OS X by masklinn on Sunday February 12, 2017 @08:20AM (#13628197)
Yeah without hole would be

    dd if=/dev/zero of=test bs=1k count=2m
Re:Mkfile(8) is severely syscall limited on OS X by justincormack on Sunday February 12, 2017 @08:21AM (#13628201)
OSX doesn't support sparse files...
Re:Mkfile(8) is severely syscall limited on OS X by parasubvert on Sunday February 12, 2017 @09:45AM (#13628534)
It does, just not at the HFS+ layer. Sparse bundles are the functional equivalent at the Vitual file system layer and are used by Time Machine and are useable by developers or via the CLI. Sparse images are entire virtual volumes and are used for FileVault.

https://en.m.wikipedia.org/wiki/Sparse_image

Re:Mkfile(8) is severely syscall limited on OS X by Wevah on Sunday February 12, 2017 @05:56PM (#13631609)
To clarify: FileVault on 10.6 and earlier; current FileVault is FDE.
Re:Mkfile(8) is severely syscall limited on OS X by id_kc on Sunday February 12, 2017 @10:02AM (#13628615)
>just not at the HFS+ layer

macOS supports sparse bundle with HFS+

Re:Mkfile(8) is severely syscall limited on OS X by parasubvert on Sunday February 12, 2017 @10:11AM (#13628657)
As I was saying, that's implemented above HFS+