native_ttyname_r function
Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number.
Implementation
int native_ttyname_r(
int fd,
ffi.Pointer<Utf8> buf,
int buflen,
) {
_ttyname_r ??= Libc().dylib.lookupFunction<
ffi.Int32 Function(ffi.Int32, ffi.Pointer<Utf8>, ffi.Uint64),
_dart_ttyname_r>('ttyname_r');
return _ttyname_r!(
fd,
buf,
buflen,
);
}