admin管理员组

文章数量:1405611

Is it possible to call copyfile on Darwin with CGO_ENABLED=0?

copyfile(const char *from, const char *to, copyfile_state_t state, copyfile_flags_t flags);

I first tried using unix.Syscall6(unix.SYS_COPYFILE, ..., COPYFILE_METADATA) but the call always returned operation not supported.

Also this may not work on future OS versions anywyas as SYS_COPYFILE is

// Deprecated: Use libSystem wrappers instead of direct syscalls.

What are these libSystem wrappers? I couldn't find any documentation and AFAIK there is no darwin copyfile wrapper defined.

I'm looking for a way to use COPYFILE_METADATA with CGO_ENABLED=0.

本文标签: Calling macOS COPYFILEMETADATA from GoStack Overflow