dna

Dart Native Access

Usage

A simple usage example:

import 'package:dna/dna.dart';

main() {
  var pid = getpid();
  print('pid ${pid}');
}

int getpid(){
  var library = nLoadLibrary('libc.so.6');
  var method = nFindSymbol(library, 'getpid');
  var vm = nCreateCallVM(256);
  var pid = nCallInt(vm, method);
  nFreeCallVM(vm);
  nFreeLibrary(library);
  return pid;
}

Requirements

Linux 64-bit

Libraries

dna

Dart Native Access