我创建了一个指向深层嵌套目录的符号链接.使用符号链接我可以从我的主目录移动到该目录.我想从目标目录移回一个目录,但shell返回到主目录.
[root@pe1800xs ~]# pwd
/root
[root@pe1800xs ~]# mkdir -p abc/def/ghi/jkl/mno/pqr
[root@pe1800xs ~]# ln -s abc/def/ghi/jkl/mno/pqr/ xyz
[root@pe1800xs ~]# cd xyz
[root@pe1800xs xyz]# pwd
/root/xyz
[root@pe1800xs xyz]# pwd -P
/root/abc/def/ghi/jkl/mno/pqr
[root@pe1800xs xyz]# cd ..
[root@pe1800xs ~]# pwd
/root
Run Code Online (Sandbox Code Playgroud)
我想要实现的是当我cd..在pqr目录中执行shell时应该到达mno目录.
当我使用搜索C符号或全局定义时cscope,它显示文件名和行号.我想看到完整的文件路径,以便我可以跳转到我的arch特定文件.例如,当在Linux代码库__switch_to上搜索on cscopebuild的全局定义时,我得到:
Global definition: __switch_to
File Line
0 process.c 297 struct task_struct *__switch_to(struct task_struct *prev,
1 switch_to.h 44 #define __switch_to(prev,next,last) do { \
2 process.c 202 struct task_struct *__switch_to(struct task_struct *old,
3 process.c 400 struct task_struct *__switch_to(struct task_struct *prev,
4 process_32.c 211 __switch_to(struct task_struct *prev, struct task_struct *next)
5 process.c 80 void *__switch_to(struct task_struct *from, struct task_struct *to)
6 process_32.c 248 __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
7 process_64.c 272 __switch_to(struct task_struct *prev_p, struct task_struct …Run Code Online (Sandbox Code Playgroud) 我需要一个静态分析工具,用于我为基于ARM的主板编写的Linux设备驱动程序.我正在考虑下面提到的一些工具:
Linux验证中心有两个活跃项目旨在提高可加载内核模块的质量.
Linux Driver Verification (LDV) - 用于Linux设备驱动程序的静态源代码验证的综合工具集.KEDR Framework - 用于动态分析和验证内核模块的可扩展框架.Linux File System Verification旨在开发用于验证Linux文件系统实现的专用工具集.-Werror,-Wextra并-Wall在GCC,并与运行Valgrind.上次我玩Sparse时发现输出很混乱,并没有找到解释输出的好文档.有没有人有关于稀疏工具的好文档?我可以用于Linux驱动程序验证的其他免费静态分析工具是什么?我知道LINT工具,但它的许可.
c memory-leaks static-analysis linux-device-driver linux-kernel
关于提供的评论,我无法理解以下代码.这段代码做了什么,以及它的等效代码是8-aligned什么?
/* segment size must be 4-aligned */
attr->options.ssize &= ~3;
Run Code Online (Sandbox Code Playgroud)
这里ssize是unsigned int类型.
在源代码实现中,它表示idr_alloc()用于分配新idr条目.我找不到man page并且想知道为什么它在使用时特别是在为MTD设备编写驱动程序时.
#include <stdio.h>
int arr[] = {1,2,3,4,5,6,7,8};
#define SIZE (sizeof(arr)/sizeof(int))
int main()
{
printf("SIZE = %d\n", SIZE);
if ((-1) < SIZE)
printf("less");
else
printf("more");
}
Run Code Online (Sandbox Code Playgroud)
编译后的输出gcc是"more".为什么if条件,即使失败-1 < 8?
我写它使用一个便携式的应用程序C++11一样的功能std::atomic,std::threads等我如何验证我的ARM GCC交叉编译工具链支持的C++11标准是什么?
我尝试使用arm-none-linux-gnueabi-g++ -v
,arm-none-linux-gnueabi-g++ --version
但在使用时返回错误-std=c++11
编辑 #arm-linux-gnueabi-g ++ -std = c ++ 11 dum.cpp
cc1plus:错误:无法识别的命令行选项'-std = c ++ 11'
目标:arm-linux-gnueabi
gcc版本4.6.2
int main()
{
int i, c;
i:
for (i = 0; i < 3; i++) {
c = i &&&& i;
printf("%d\n", c);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
上面编译的程序的输出gcc是
0
1
1
Run Code Online (Sandbox Code Playgroud)
如何在上述计划中评估?
我尝试用终止进程sudo kill 30602。但是在我杀死它之后,我使用它ps aux | grep gmond进行检查,并再次显示另一个pid,就像:
ganglia 30997 0.0 0.1 121812 2128 ? Ssl 16:05 0:00 /usr/sbin/gmond --pid-file=/var/run/ganglia-monitor.pid
Run Code Online (Sandbox Code Playgroud)
无论我如何杀死它,它都会再次显示另一个pid,即使使用kill -9。
有什么问题?以及如何解决呢?
我正在尝试使用个人资料图片进行signUp活动,但是我收到一条错误消息:无法对未保存的解析文件进行编码.我在另一个类中有相同的代码,它没有任何问题.
我认为问题可能是使用ParseUser而不是ParseObject.请帮帮我,这是我的代码.
public class SignUpActivityStep3 extends ActionBarActivity {
public static final String YOUR_APPLICATION_ID = "kuN8ihs88AYhRR1jIWT9psCGUXxSOveJPqVVsBnq";
public static final String YOUR_CLIENT_KEY = "vC4eA9CqulpgkxJ7sTPtoPSANkMxFeiFlYXwODYK";
byte[] Image;
ParseFile photo = null;
String User, Pass, Email, Description;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signupstep3);
Parse.initialize(this, YOUR_APPLICATION_ID, YOUR_CLIENT_KEY);
EditText Desc = (EditText) findViewById(R.id.txtDesc);
Button Finish = (Button) findViewById(R.id.btnFinish);
Intent intent = getIntent();
User = intent.getStringExtra("User");
Pass = intent.getStringExtra("Pass");
Email = intent.getStringExtra("Email");
Image = intent.getByteArrayExtra("Image");
photo = new ParseFile("userpicture.png", Image);
photo.saveInBackground();
savetoParse();
}
private void …Run Code Online (Sandbox Code Playgroud)