|
#include<stdio.h>
9 ~" e- w& I, n3 V$ ~ s9 f% ^#include <string.h>
) S4 R) J% \3 T& b( f#include<sysan.h>) H8 y0 L* ~ |
#include<fcntl.h>
4 i( J3 S! B1 j. _, N#include<errno.h>
8 y2 \5 n" p; W3 g- N: ]int main(void)
( E1 u2 @) V+ P' r/ m: ^{ , G" V. q% N: |7 }( _* v
int fd;5 y7 w4 J' V4 r
fd=open("dev/mem", 0); / {3 w( l. X! b* T
printf("==(%d)==%s==",fd,strerror(errno)); ( g; L4 v$ w! J! P+ n
}
5 C1 f. x' h2 c# O3 f+ D3 S在OMAPL138开发板上运行时总是打印
' r9 n" @+ Y4 [1 e, v4 n" i* s) E* F==(-1)==No such file or directory==* {/ S3 _; D5 v& N' h; U
就是说dev/mem 不存在的意思? 在dev确实存在mem呀.
7 ~) A. f% E o b4 i4 F5 v% c- E请问这是什么原因导致打开dev/mem失败呀?+ V, q$ q# x$ q0 L# b: B& n
. Y4 X, t: t8 `0 V# m$ S; O4 v
- i$ G9 J# D: B3 E+ x |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|