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
Tag: c++
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
Creating three children in C that have the same parent
My problem is that the children does not have the same parent and does not appear correctly, here is my code: As of right now when i run the program i will get this as output in bash, where bash has the PID of 11446: How do i get the first child to appear first, second child to appear second
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
C++ Compiler errors after changing LPBYTE to unsigned char* in Win DLL to Linux SO conversion
I am working on converting a Windows DLL to a Linux SO. I have converted all of the types BYTE to unsigned char and LPBYTE to unsigned char*. The compiler is giving me errors in one function as follows: Error: Invalid Conversion from ‘char*’ to ‘unsigned char’ Error: Invalid Conversion from ‘unsigned char’ to ‘unsigned char*’ Specifically at these two
Seg fault when app & shared lib built with -static-libstdc++
If I build a C++ app with -static-libstdc++ which loads a shared lib (via dlopen) which was also built with -static-libstdc++, then the app seg faults during dlopen. BUT–this only happens in some setups: GCC 4.7.4, 32-bit: pass GCC 4.8.3, 32-bit: pass GCC 4.8.4, 64-bit: pass GCC 4.9.2, 64-bit: pass GCC 4.9.3, 32-bit: FAIL (unless RTLD_DEEPBIND is specified) GCC 4.9.3,
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: