I am looking to run a program on a target that is in memory. For example I would like to call LaTeX on a set of characters in the memory instead of in file. I realise I can set a file pointer in C to target memory and read/write to and from memory. However I don’t know if there is
Tag: c++
Is it safe to use boost provided shared memory and rt_signal (provided in linux) for realtime system?
I am currently working with building realtime IPC system. I am trying to build a realtime system free of all undeterministic components. I try to setup IPC based on shared memory model. Is it safe to use managed_shared_memory from boost library to minimize unpredictable latency? or should I use mmap() for memory sharing? Also Is rt_signal which has channel from
Rst packets sent with libnet do not reset the connection
I am trying to do ‘rst hijacking’ by using a c script with libcap and libnet included. I use libcap to sniff all packets coming from and going to a host given as input to the program via the commandline. Then libnet sends rst packets to the host trying to connect to the specified host. However when I run the
BPF: `bpf_obj_get_info_by_fd` fails with `Invalid argument`
I try to get the fd of the BPF_MAP_TYPE_XSKMAP in my user-space program. This is the code: But unfortunately, I get an error for calling bpf_obj_get_info_by_fd(cfg->prog_fd, &prog_info, &prog_info_len): Failed to obtain prog_info 1: Invalid argument. I don’t know if this is because the XDP-program is loaded from another process? Does the same process have to obtain program information which also
Clang 11 and GCC 8 O2 Breaks Inline Assembly
I have a short snippet of code, with some inline assembly that prints argv[0] properly in O0, but does not print anything in O2 (when using Clang. GCC, on the other hand, prints the string stored in envp[0] when printing argv[0]). This problem is also restricted to only argv (the other two function parameters can be used as expected with
How can I stop the while?
I have A TCP Server-Client where I enter a number with the number of times that I want to send the word to the server. So I send correctly because I print the information on a loop(in client) but in the server shows infinitely because I put while(1) but if I don’t use just print it one time. I don’t
Segmentation fault error as the reader tries to read from the shared memory
I am trying to understand the System V shared memory APIs. I created a small program where one writes into the shared memory and another reads from the shared memory. But for some reason, I am getting an error : as I try to read from the shared memory. I could not find the reason for it. Here is what
What is “(void*)-1” in the context of sbrk’s return value?
The Linux Man Page for sbrk() states that upon failure, it returns (void*) -1. What is (void*) -1 and does it have any significance or is it simply a number that could never actually be a void* which is cast to a void* just to meet the function signature of returning a void*? I ask this because I’ve never seen
How to get supported display refresh rates on Linux?
drmModeModeInfo structure from DRM contains uint32_t vrefresh; field, and the values are actually good there i.e. I’m getting 24-75Hz for different video modes. But refresh rates aren’t integers, they’re rational numbers, right now for my display the value is 59997/1000. Is it possible to get the precise numbers on Linux? Or at least a floating point value? Answer The numerator
Assimp aiString empty when compiling for Linux
I’m working on a simple OpenGL project and I’m new to C++. I’ve been slowly adding features to a very simple primitive 3D “engine” and I’ve worked to make sure it compiles cross-platform. I have a make file that I run for OSX and Linux (Ubuntu) and for Windows I have a Visual Studio solution file modified to work with