linkat function
Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively.
Throws a PosixException if an error occurs.
Implementation
void linkat(
int __fromfd,
String from,
int __tofd,
String to,
int flags,
) {
final cFrom = from.toNativeUtf8();
final cTo = to.toNativeUtf8();
_linkat ??= Libc().dylib.lookupFunction<
ffi.Int32 Function(ffi.Int32, ffi.Pointer<Utf8>, ffi.Int32,
ffi.Pointer<Utf8>, ffi.Int32),
_dart_linkat>('linkat');
final result = _linkat!(
__fromfd,
cFrom,
__tofd,
cTo,
flags,
);
_throwIfErrno('symlink', result, cFrom, cTo);
malloc
..free(cFrom)
..free(cTo);
}