小编man*_*m-n的帖子

当路径包含符号链接时,如何在unix/linux中移回一个目录?

我创建了一个指向深层嵌套目录的符号链接.使用符号链接我可以从我的主目录移动到该目录.我想从目标目录移回一个目录,但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目录.

unix linux shell symlink cd

7
推荐指数
2
解决办法
3万
查看次数

如何在搜索过程中使cscope显示完整的文件路径

当我使用搜索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)

linux ide search ctags cscope

7
推荐指数
1
解决办法
3289
查看次数

用于Linux内核模块和设备驱动程序的静态分析工具

我需要一个静态分析工具,用于我为基于ARM的主板编写的Linux设备驱动程序.我正在考虑下面提到的一些工具:

  1. Sparse是一种计算机软件工具,已在Linux上提供,旨在查找Linux内核中可能存在的编码错误.
  2. Linux验证中心有两个活跃项目旨在提高可加载内核模块的质量.

    • Linux Driver Verification (LDV) - 用于Linux设备驱动程序的静态源代码验证的综合工具集.
    • KEDR Framework - 用于动态分析和验证内核模块的可扩展框架.
    • 另一个正在进行的项目Linux File System Verification旨在开发用于验证Linux文件系统实现的专用工具集.
  3. 启用-Werror,-Wextra-WallGCC,并与运行Valgrind.

上次我玩Sparse时发现输出很混乱,并没有找到解释输出的好文档.有没有人有关于稀疏工具的好文档?我可以用于Linux驱动程序验证的其他免费静态分析工具是什么?我知道LINT工具,但它的许可.

c memory-leaks static-analysis linux-device-driver linux-kernel

7
推荐指数
1
解决办法
6258
查看次数

这个尺寸对齐是如何工作的

关于提供的评论,我无法理解以下代码.这段代码做了什么,以及它的等效代码是8-aligned什么?

/* segment size must be 4-aligned */
attr->options.ssize &= ~3;
Run Code Online (Sandbox Code Playgroud)

这里ssizeunsigned int类型.

c c++ struct bit-manipulation memory-alignment

7
推荐指数
3
解决办法
3153
查看次数

什么是idr_alloc()

在源代码实现中,它表示idr_alloc()用于分配新idr条目.我找不到man page并且想知道为什么它在使用时特别是在为MTD设备编写驱动程序时.

memory linux-device-driver linux-kernel embedded-linux

7
推荐指数
1
解决办法
2777
查看次数

为什么这个if条件失败用于比较负整数和正整数

#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 c++ comparison signed if-statement

7
推荐指数
4
解决办法
6381
查看次数

如何检查arm-none-linux-gnueabi-g ++对C++ 11的支持

我写它使用一个便携式的应用程序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

c++ gcc arm cross-compiling

7
推荐指数
1
解决办法
8238
查看次数

什么是C中的&&&&操作

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)

如何在上述计划中评估?

c c++ linux operators gcc-warning

5
推荐指数
2
解决办法
1211
查看次数

我杀死它后,该过程会自动再次出现

我尝试用终止进程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

有什么问题?以及如何解决呢?

linux ubuntu kill process inittab

5
推荐指数
1
解决办法
5367
查看次数

无法使用ParseUser编码未保存的解析文件

我正在尝试使用个人资料图片进行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)

android parse-platform

5
推荐指数
1
解决办法
3788
查看次数