Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question I have a project in Linux, but it’s cross platform code. How can I c…
Tag: linux
MacOS Create a Process in suspended state
Use-case Create a new process ( running an arbitrary application ) in suspended mode ( using eg. exec ) Process created ( MachO loaded ) but no single line of code executed Do some stuff w/ the suspended process memory Resume the process On windows, once can use CreateProcess in conjunction with the “CR…
After update linux to version 4.2, Java write “Failed to write core dump”?
I work on one programm, that need to java 7. But when I update archlinux to 4.2 (from 4.1) ,when I start the programm, java write me: Java not update!! What happend with java and what do I need? EDIT: I found, when start the programm, he added keys -J-XX:PermSize=200m -J-XX:MaxPermSize=256m. When I delete th…
Linux – Get the start and end of the stack memory for a thread
I am trying to port something to Linux. My original code (for a RTOS) looks like: Later the stack and stackSize are used by the garbage collector and to get some thread statistics. Now, how do I convert the above code to Linux? Answer You should use Pthread: http://www.manpagez.com/man/3/pthread_attr/ http://…
Using a shell commands in c++
Here’s a terminal command: Here’s my code: The above code, when run, returns this message: How can I place the ‘/’ symbol, for this command to work correctly? Answer Your problem is not in C++. You are invoking your command with popen, and popen runs your command in sh shell, that does…
Platform specific code in Eclipse
We’re developing a java desktop/Eclipse RCP application with a graph-layout component. We faced issues with the GUI scaling on newer(8, 8.1, 10) versions on windows, it appeared that one can only retrieve the scaling factor through win32 api calls, so we added a little DLL that does this and call it thr…
Sed replace all matches after some patterns
I want to replace all B after ‘=’. The expected result should be But I got this result: Only the last matched pattern be replaced. How to resolve it? Answer Use this sed: Test:
Linux SDL2 application no transparency outside Code::Blocks IDE
I have some strange problem, origins of which I don’t understand. I have an SDL2 application built and working on Windows, and now I’m trying to build a Linux version. I am using Code::Blocks on both systems. After I set up all the paths and libraries in Code::Blocks on Linux, it builds and runs n…
Bash Brace Expansion in Systemd ExecStart
The following test is in CentOS 7.1. Create the following file test.service in /usr/lib/systemd/system/ and execute systemctl daemon-reload; systemctl restart test; systemctl status test -l There is no output of the value as the ${a} does not substitute as the word hello world, until it is changed echo ${a} i…
How to Obtain Youngest Child’s PID from task_struct
I’m working on a project that involves writing a new system call for Linux 3.18.20. This system call is supposed to store various information about the currently running process in a newly defined struct. One of the fields of the struct is the PID of the process’s youngest child, and I’ve be…