tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / libkvm / kvm_read.c
blob1603767165896d87d7a91c778b6db85c6581af3c
1 #include <exec/types.h>
2 #include <fcntl.h>
3 #include <kvm.h>
4 #include <string.h>
5 #include "kvm_errors.h"
7 ssize_t kvm_read(kvm_t *kd, unsigned long addr, void *buf, size_t nbytes)
9 if (kd == (kvm_t *)(O_WRONLY|0xdead0000)) {
10 __kvm_errno = KVMERR_NOACCESS;
11 return -1;
13 if (addr) {
14 memcpy (buf, (void *)addr, nbytes);
15 return nbytes;
16 } else {
17 __kvm_errno = KVMERR_BADADDRESS;
18 return -1;