|
#include<stdio.h> . l5 Q- l0 k$ y
#include <string.h>
3 N/ O& P* n1 h/ W# _#include<sysan.h>+ A% j+ Y* [+ m! s3 v
#include<fcntl.h>
$ o g7 v2 ?8 K( K/ {: R- H. j1 v2 j#include<errno.h>% @7 k, b- p$ s7 l
int main(void)
; G! q# v2 s- L5 Q) n1 `5 e- K{
G% C! V. d, b9 b! i8 ?% b int fd;
) T" ?4 v9 e' O) C# ~' i fd=open("dev/mem", 0);
0 T7 {2 t7 m0 x3 J9 j printf("==(%d)==%s==",fd,strerror(errno));
0 V* g& ` X, j$ P- ?}) h: a& e" D J0 u) o" y O
在OMAPL138开发板上运行时总是打印6 A( p; J: U9 B3 W( a9 F" ?3 ^
==(-1)==No such file or directory==
3 P6 |6 f- f/ I2 A; c2 w8 @就是说dev/mem 不存在的意思? 在dev确实存在mem呀.
3 e2 s% M0 j; s8 \/ N4 q* d请问这是什么原因导致打开dev/mem失败呀?3 Z; ?8 S9 U- q! n
4 S* T3 S2 X. c* l5 C4 C q# F2 S" q* o4 G1 w9 s3 T
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|