error: /usr/include/stdio.h: Permission denied 的一种情况分析
代码:
- #include <stdio.h>
- int main(){
- printf ("hello long size %d\n",sizeof(long));
- }
很简单,测试是否能够编译通过
对比
- 在root的用户下编译正常通过
- 在其他用户测试不通过
点击(此处)折叠或打开
- ~> gcc test.c
- test.c:1:19: error: /usr/include/stdio.h: Permission denied
- test.c: In function 'main':
- test.c:5: warning: incompatible implicit declaration of built-in function 'printf'
尝试着解决问题
提示说是权限受限。
在root用户下看看stdio.h的属性点击(此处)折叠或打开
- ll /usr/include/stdio.h
- -rw-r--r-- 1 root root 31144 2010-05-06 10:33 /usr/include/stdio.h
具有可读属性,但是用vim打开,显示是个 [new file], 为什么呢?
具有可读权限就是看不到文件!给文档添加可执行权限,chmod +x /usr/include/stdio.h
问题如故给link添加可执行权限,# find /usr/include/ -type l -exec ls -l {} \;
问题如故去除link的可执行权限,# find /usr/include/ -type l -exec chmod -x {} \;
给文件夹添加可执行权限,# find /usr/include/ -type d -exec chmod +x {} \;
问题解决
分析
我不明白,打开/usr/include/stdio.h 和其他文件夹的可执行权限有什么相关,因为/usr/include和/usr/include/stdio.h 都具有可行性,用户应该可以读取stdio.h文件才对啊。
这个情况出现在移植的过程中,为了防止不必要的麻烦,添加如下命令,chmod -R 755 /usr/include/
error: /usr/include/stdio.h: Permission denied 的一种情况分析的更多相关文章
- error: /usr/include/objc/objc-class.h: No such file or directory
When i use the example of ShareKit package,i have come across this error:"error: /usr/include/o ...
- #include <stdio.h>
1 fflush 2 fgetc 3 fgets 4 fprintf 5 fputc 6 fputs 7 fscanf 8 fseek 9 ftell 10 perror 11 remove 12 r ...
- 第二次作业#include <stdio.h> int main() { int a,b,c,d,e; printf("请输入一个不多于五位的整数:\n"); scanf("%d",&a); if(a>=100000||a<=0) { printf("输入格式错误! \n"); } else { if(
1 判断成绩等级 给定一百分制成绩,要求输出成绩的等级.90以上为A,80-89为B,70-79为C,60-69为D,60分以下为E,输入大于100或小于0时输出"输入数据错误". ...
- git报错 error: cannot stat ‘'web/js': Permission denied
切换分支时报错: error: cannot stat ‘'web/js': Permission denied 解决方法:退出编辑器.浏览器.资源管理器等,然后再切换就可以了.
- c语言输入与输出库函数#include<stdio.h>
last modified: 2010-05-28 输入与输出<stdio.h> 头文件<stdio.h>定义了用于输入和输出的函数.类型和宏.最重要的类型是用于声明文件指针的 ...
- [pod install] error: cannot open .git/FETCH_HEAD: Permission denied
pod installAnalyzing dependencies[!] Pod::Executable pull error: cannot open .git/FETCH_HEAD: Permis ...
- #include<stdio.h> #include "stdio.h"
https://baike.baidu.com/item/#include <stdio.h> #include <stdio.h> 编辑 #include<stdio. ...
- #include stdio.h(B)
#include <stdio.h> int main() { //***********一.循环语句*************** //什么叫做循环: //重复的做某件事情,重复的执行一 ...
- #include stdio.h(A)
/* 第一个*******知识点工程相关信息******** 1.创建工程 文件->新建->工程->win32 console applecation ->文件名不能为汉字 2 ...
随机推荐
- 一步一步重写 CodeIgniter 框架 (5) —— 实现Controller,并加载Model
CodeIgniter 框架采用MVC模式,而MVC模式中起纽带作用的就是C(控制器),在控制器的中通过加载模型获得数据,将数据传到视图中进行展示.本课将实现在控制器中加载模型. 1. 控制器的实现 ...
- SQL__用命令删除定期的备份数据库文件
用计划任务可以定期执行下列语句: FORFILES /P e:\test /M *.bak /C "cmd /C del /Q @path" /d -4 其中可更换目录与文件类型. ...
- 一天一个类--ArrayList之一
今天开始打算将JDK7种的一些类的源码分析一下,笔者认为了解源码就是了解其实现过程,这是非常重要的,而不是简单的记住方法的使用,关键是了解其思想和目的这才是重要的.所以笔者决定首先将从一些容器下手.[ ...
- Unix时间戳 POSIX时间 Unix时间
Unix时间戳(Unix timestamp),或称Unix时间(Unix time).POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日00时00 ...
- Away3D带你360°漫游全景影像
1代码展示 package { import away3d.containers.View3D; import away3d.controllers.HoverController; import a ...
- Vbox视图热键
Vbox屏幕热键 在Vbox中一般host主键会默觉得"右Ctrl",例如以下图所看到的,在选择自己主动调整窗体后,"视图"选项栏会消失.这时若想更改视图设置能 ...
- Java中StringBuilder的清空方法比較
StringBuilder 没有提供clear或empty方法. 清空有3种方法: 1)新生成一个,旧的由系统自己主动回收 2)使用delete 3)使用setLength 将三种方法循环1000万次 ...
- Fragment保持状态切换,fragment状态切换
在使用Activity管理多个Fragment时,每次切换Fragment使用的是replace,结果导致出现xxx is not currently in the FragmentManager异常 ...
- webservice asmx 无法序列化接口 System.Collections.Generic.IList
转载自:http://www.cnblogs.com/chenhuzi/p/4178194.html 今天有位同事在方法里加了一个IList<entity> 的返回值,也没有测试,直接发布 ...
- itextSharp 使用模板(PdfTemplate)不规则分栏(ColumnText)
public static void Main() { Document document = new Document(); BaseFont bf = BaseFont.createFont(Ba ...