I'm porting some C code that does manual filesystem "extent" 
file space management from Linux to Darwin (and into Go). 

The Linux fallocate() call and its FALLOC_FL_INSERT_RANGE 
operation are not directly available on Darwin, but suggestions from 
StackOverflow
indicate that fcntl(2) with F_PREALLOCATE might be a close substitute.

It seems to be working. Full code here in this playground, but I have a 
couple of questions--

https://go.dev/play/p/Z5JB__fUBpI

Can I get away without the runtime.Pinner? (Am I still safe from 'store' 
being pre-maturely garbage collected without the pin, since Go memory has 
been converted to an uintptr before calling unix.Syscall())

Is there a more appropriate way to call fcntl() (on Darwin)?

Thanks for any guidance here.

Jason

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/93a46345-3e28-4442-a0e7-b08b8811cf6en%40googlegroups.com.

Reply via email to