Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在C和mmap()中代表什么_C_Mmap - Fatal编程技术网

在C和mmap()中代表什么

在C和mmap()中代表什么,c,mmap,C,Mmap,1在前面的代码中,&'运算符是什么意思?它是。这意味着操作的结果是执行两个操作数的二进制和,但以逐位方式执行,即 在这种情况下,检查present指向的内存的第一位是否为0。-1因为缺乏研究工作供将来参考:下一次你问问题时,确保你表明你已经做了研究工作,而不是简单地把问题抛在一边。你肯定会避免落选,并吸引更多积极的帮助。 int fd = open("/dev/mem", O_RDWR); present = (unsigned char *)mmap(0, get

1在前面的代码中,&'运算符是什么意思?

它是。这意味着操作的结果是执行两个操作数的二进制和,但以逐位方式执行,即


在这种情况下,检查present指向的内存的第一位是否为0。

-1因为缺乏研究工作供将来参考:下一次你问问题时,确保你表明你已经做了研究工作,而不是简单地把问题抛在一边。你肯定会避免落选,并吸引更多积极的帮助。
int fd = open("/dev/mem", O_RDWR);
present = (unsigned char *)mmap(0, 
              getpagesize(), 
              PROT_READ|PROT_WRITE, 
              MAP_SHARED, 
              fd, 
              0x22400000);

if ((*present & 1) == 0)
{
  printf("Converter not present\n");
  exit(1);
}