|
#include<stdio.h> 2 Z" z& a% w9 t1 Z2 H
#include <string.h>2 l L7 g3 r, m9 g/ H4 h7 k1 H
#include<sysan.h>8 ^. I( O6 }4 D- M
#include<fcntl.h>! W/ F3 D! Q" L5 z f
#include<errno.h># {! f X* U# j1 o( [, K# O
int main(void)- Y" `2 k" Q6 V& {! m
{ 9 r' s( G% l N' ^2 x
int fd;0 W* P K- h' X
fd=open("dev/mem", 0); 6 E: H8 m: [8 ?% Y" m% ?
printf("==(%d)==%s==",fd,strerror(errno));
# Q. F. ~) K* o* p6 P% a8 K" A% i1 v}. b/ r; M8 o# W6 i
在OMAPL138开发板上运行时总是打印
3 R4 y0 C( [3 q! x==(-1)==No such file or directory==
' M, g# X; b' \* C, k就是说dev/mem 不存在的意思? 在dev确实存在mem呀.
; ?6 F/ r( N3 g. s请问这是什么原因导致打开dev/mem失败呀?/ H- @/ U. `: c; y5 Q3 b4 p! G
; M; S% ?) B4 ` k' a) R5 g
* T; J: z* e" H5 `/ C( m
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|