Skip to content
Advertisement

Tag: c++

rpm -q -> query only the descripton

I can query the informations about a rpm-package with Example-Result of a Query: But I only want to query the Description. Is that possible? The reason for that is that I want to process this information (the Description) in a C++ Program (I do this with popen()). Maybe something like this: Answer This is the correct sollution:

How to exit while loop when read() blocks

In a problem given by university we have to pipe from a parent process(P1) to its child P2, and afterwards P2 must pipe to another child of P1, the other child is P3. Both P2 and P3 are to be written in c and made into executable files. They will then by execed by child processes in P1. P1 writes

Ruby, ffi, and a custom C library

I’m trying to create a custom C library I can call from Ruby using FFI. My library will wrap certain libtiff functions with my own code, and the resulting higher-level functions will be called from within Ruby via the FFI interface. I’ve got test code working in C, that compiles successfully to a .so file. I’ve got that same code

fork: child process doesn’t stay in an infinite loop

In the above code snippet inside if statement if we put while(1), it doesn’t remains blocked and when enter key is pressed program is exited, but in case of parent if we put while(1), parent remains blocked until we give ctrl+c. Please clarify this behaviour of child. Answer In the above code snippet inside if statement if we put while(1),

Wait for signal, then continue execution

I am trying to make a program that suspends its execution until a signal arrives. Then, after the signal arrives I just want my code to continue its execution from where it was. I don’t want it to execute a function handler or whatsoever. Is there a simple way of doing this? I have been struggling for a week or

Advertisement