It's not quite the same.  The mac one converts to number of 512 byte blocks, this goes to bytes.  I guess I could reuse and then multiply by 512, if you think that's important.