Skip to content
Advertisement

Tag: c++

How to protect an eBPF firewall in traffic filter (tc-bpf)

I’m going to implement a firewall on the traffic control classifier(man 8 tc-bpf). The firewall is to filter outgoing traffic. But, there is one point which makes the task really hard. My userspace agent must know, is that filter(classifier) loaded and passing all outgoing traffic through itself or not. Please tell me: How to protect loaded filter from unloading(tc filter

C close() : Invalid argument

Sorry per advance for my english, i’m not english native and be indulgent i’m also a student. I’m trying to recreate the pipe function in C, but i have a problem when i try to close pipe fd before the dup2(), the function close() return me an error Ïnvalid argument, i have already check if my fd is valid and

A c program file on linux became green and now I cannot edit it

Hi I have a c file in program which is called helloQV.c I ran the command gcc -Wall -ansi -std=c99 helloQV.c -o helloQV.c but now I cannot edit the file helloQV.c, when I open the file in vim it turns out to be just a bunch of random symbols. I realized I should have named the -o HelloQV.c to something

Stringizing / stringify name mangling

I load a path name with cmake and want to use as a string in my C++ program to load some data. For this the stringification operator # is really handy – I use the macro provided in this answer which is the same as here. Now when I have “linux” or “unix” in my path, this goes horribly wrong

OpenMP Matrix Multiplication Issues

I am trying to multiple the values of a matrix. I have both a parallel and sync version. But the parallel version is longer than the sync version. Current the sync takes around 90 seconds and the parallel over 100. Which makes no sense to me. My logic was to split the matrix into 4 parts from the first 4

Changing the file’s creation timestamp in Linux programmatically in C/C++

The statx() system call was added to Linux kernel and now it is possible to get the creation (birth) time of the file from statx.stx_btime stucture field on supported filesystems. But I can’t find any support in utimensat() of similar system calls. Is it possible to change file’s creation timestamp in C/C++ and how? Answer statx.stx_btime is filesystem-specific. Linux has

Advertisement