dna 0.0.1
dna: ^0.0.1 copied to clipboard
Dart Native Access.
// Copyright (c) 2016, root ext. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
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;
}