I am exercising Linux timestamping functionality (TX part): https://docs.kernel.org/networking/timestamping.html It looks like there is no easy way to understand that the system will never provide me with TX timestamps at runtime. It means that I can enable TX timestamping via setsockopt without an error: even on a system which does not support TX timestamps at all. And then I can
Tag: c++
can I reuse the socket when update SSL certificate?
The old SSL certificate has expired and I want to renew the SSL certificate. However, the server already has established multiple links with other clients. So, can I just bind the old sockets to the new ssl, which means I don’t need to disconnect the old base tcp links? Answer Existing TLS connections don’t need to get updated with a
Multi-Process Shell in C, using Pipes [Linux]
I’m trying to code a shell in C that supports multi-pipe process handling, depending on the amount of separate processes given by the user, and each separated by a “|” symbol. The shell forks the amount of processes into a child for each process. Here’s an example: result: 1 But I’m having trouble with communicating between children and finally to
How do I read a dbus array of dicts with the c api sd-bus?
I am try to read a dbus data structure that looks like this a{sv} with sd-bus but when i use the code down below i can only read one of the 8 dicts. I have looked up the function sd_bus_message_enter_container on hotexamples.com and all of them seemed to have while more than one loop around the function that enters the
Error while trying to compile an c++ sdl2 program with mingw
Basically, when I’m trying to compile my program for windows on linux, I get such an error: My main function starts like this: My compiling script looks like this: And this is my file structure: Any clues on why can’t I compile it? Answer Oh, okay I was just dumb, didn’t pass the name of main.cpp to the compiler.
why called function can get arguments of parent-function by va_start()?
I implemented a function with variable arguments below: Then I hope to implement another named “errExit()” based on the function above. I just tried like below.It works as I hoped but I dont’t think it correct. I tried errExit(“hello,%s,%s,%s”, “arg1″,”arg2”, “arg3”); and it printed “hello,arg1,arg2,arg3” correctly. But after I added two line code like below, it throwed error Segmentation fault.
how to achieve backward compatibility with missing shared library
I upgrade a program that needs to run on both old and new platform. In the new platform, I have new config so certain functions will not get called in the old platform. However, when I run the program on old platform, it complains missing shared library. What I need is something like “lazyload” or “delayload” mechanism such that when
Should fsync() be called before or after write() call?
I understand the working of write() call wherein it writes the data only to kernel’s buffers which is later written to disk by kernel after sorting the data optimally. Calling fsync() on file descriptor makes sure that data is written to disk as soon as it’s posted in the kernel’s buffer. My question is, whether fsync() should be called before
How to find process arguments of running processes in dotnet c# on linux
I have a program that needs to kill any other instances of itself when it starts. In windows I can do this well enough (without WMI) by getting processes by name and searching for the exe of the application (which is unique enough for this to work well enough). In linux it’s all dotnet foo.dll so every dotnet application is
Understand shell script interpreter with custom shell [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 months ago. Improve this question I try to understood how shell script interpreter working. for example i wrote custom shell with c++ : now i wrote a script like this