Skip to content
Advertisement

Tag: c++

Pointers given from user space to kernel space are null

Sorry if this question has been asked before as it seems kind of basic, but I can’t find it anywhere on this site. I’m doing OS programming with linux (debian) and I’m trying to give a pointer from my user space to my kernel space function. Namely in the userspace I do and in the kernel space file kernel_function.c I

OpenCV 3.1 Upgrade Leads to Linker Errors on Linux

I’ve recently upgraded from OpenCV 2.4.11 to OpenCV 3.1 by following this guide. This sudo make install seems to have worked successfully and when I run pkg-config –modversion opencv, I get the appropriate version (3.1.0). But for some reason, I am now running into linker errors, and even simple programs are unable to compile, for example: returns the errors: main.cpp:-1:

SigCgt value is not getting updated in /proc//status file?

I have read about the signal handling in linux processes. I am using centOS 7.1 (kernel 3.10+). I am registering handler only for SIGTERM in my c++ program. As per my knowledge(not sure if my assumptions are correct). We can check all the signals a process is listening to in /proc/$pid/status file by using SigCgt field mask. My process’s /proc/$pid/status

Why is execvp() executing twice using fork()?

I am implementing a shell. When attempting a command other than changing directories, execvp() runs, the child terminates and a new child is created. When I change directories, the child does not terminate and a new child is created. Here is a sample of my code: cd ../; ls; runs correctly, except I have to Ctrl+D twice to end the

How to execute a shell script using CMake post_build?

How to execute a shell script using CMake? The command that should be run is my_script that should be executed after build. The CMakeLists.txt DISCLAIMER Yes, there are similar questions in SO here, here, here, etc; however, they don’t give me a clear vision how this can be achieved. Answer You are invoking CMake with it’s command-line tool mode which

What is the difference between read+write and read+write+truncate?

This is an easy question, but I couldn’t find an explanation anywhere I’m using fopen in C++, and I have the option to either use “r+b” (Read and Write) Or w+b” (Read Write and Truncate) What is the meaning of Truncate? What is the difference between “r+b” and “w+b”? I understand the mathematical meaning of truncate is removing precision after

Mono and Array.Sort

How can I use Array.Sort(someArray) in Mono with the Monodevelop !? I’m using Mono 4.2.2 and Monodevelop 5.10. Did I has to import some namespace? Which one? Is there another method to use? I’ve been trying that and don’t works: Answer Array is in the System namespace and is included within mscorlib (Mono/.Net 2/4/4.5+). Using: Cut/Paste example: Output:

Advertisement