Skip to content
Advertisement

Tag: c++

Waiting for system call to finish

I’ve been tasked to create a program that takes a text file that contains a list of programs as input. It then needs to run valgrind on the programs (one at a time) until valgrind ends or until the program hits a max allotted time. I have the program doing everything I need it to do EXCEPT it isn’t waiting

Convert char array of C into string of C++

I need to convert char array of C into string c++ but the char array is an element of struct. Code: This is my Structure in C and I want to access name[50] in c++ but for that I have to convert it into string. I have tried strcpy and memcpy. I am using ESL_BOOL status; and it is working

Pass array to C# from C++ via mono

I need to pass an array from C++ to C# using mono. But I can’t get mono_array_set() to compile. So how can I pass an array from C++ to C#? I’ve tried mono_runtime_invoke() which compiles but gives a runtime error. Answer This works:

Using makefile, LD_PRELOAD to executable file

I have two files, “abc.c” and “run” and I want to make a executable binary file which perform below two intstructions I tried to use makefile in linux, but failed. Can I use makefile to make executable binary file ? Answer Ideally, makefile should be used for compilation. For automating the shell commands, you can use a shell script. Maybe,

What counts as a symbol while mangling C++ names on Linux?

On Linux g++/clang++ is mangled as _Z10test10058lPFPvS_EPFS_PKvEPFS3_S_E According to g++/clang++, how many symbols are there in this function definition ? What are the substitutions ? (S_, S0_, S1_, …) More specifically what is S3_ ? (edit – adding some context) The D language allows to interact with C++ by declaring symbols as extern(C++). Unfortunately the current implementation is not always

C: Trying to implement unnamed pipes

I’m trying to make a program that simlutates the terminal’s nameless pipes. For example, if I want to run the command: ls –l | grep ‘10’ would be: ./pipes ls -l – grep ’10’ (I use – instead of |). However, my program doesn’t work because execvp fails (bad adress). This seems impossible to me. What am I doing wrong?

SO_RCVTIME and SO_RCVTIMEO not affecting Boost.Asio operations

Below is my code When I use Telnet to connect, but not sending data, it does not disconnect from a Telnet timeout.Will need to do to make setsockopt kick in? Thanks! I have modified SO_RCVTIMEO to SO_SNDTIMEO. Still unable to timeout in the specified time Answer Using SO_RCVTIMEO and SO_SNDTIMEO socket options with Boost.Asio will rarely produce the desired behavior.

Advertisement