I have written simple server/client programs, in which the client sends some hardcoded data in small chunks to the server program, which is waiting for the data so that it can print it to the terminal. In the client, I’m calling send() in a loop while there is more data to send, and on the server, I’m doing the same
Tag: c++
Can I get symbol names from one .so and make another .so see it?
I’ve built zlib and libpng separately (what are these libs doesn’t matter), so I’ve got libz.so and libpng.so now. With dlopen() and dlsym() I get function pointers from libpng.so and use them, but the problem is that, since libpng depends on zlib, I get linker errors when libpng function calls some zlib function inside itself. So my quiestion is: Is
python ctypes C++ get back char* missing last character on linux
i have the following C++ code: which is using ifreq to get the mac address of the local PC and sticks it into a array of chars. The routine gets compiled in the “Utility.so” Then i have the following python code: and i get the following result 02:00:AC:99:00:9 when my MAC is actually: 02:00:AC:99:00:9C So im’ missing the last char.
Print rectangles to terminal
I’m trying to write a text editor for Linux that looks like MS-DOS EDIT. However, I’m stuck because I can’t figure out how to draw the thin rectangles around the editor screen and dialog box. I know the Linux dialog command can do something similar: How can I draw rectangles like that around the screen (preferably without curses)? Answer Once
How do I find symbol offset in .so from runtime address
I need to be able to convert an instruction pointer (from a backtrace) into a file and line number after a program has terminated. During execution, I can store any additional information I will later require for this offline analysis, but the analysis does have to happen offline. Right now, I along with emitting the instruction pointers, I am emitting
How to stop backspace from appearing in nCurses using C?
I am currently writing an ncurses shell and in order to read input it is important to read it character by character and hence I am using the mvwgetch command. And incrementing a counter as it reads character by character. The problem is that whenever I press a an arrow key or a backspace their output is being printed. So,
Is using chdir() the only way to change the working directory in Linux C?
I have been given an assignment where I have to build a custom terminal using ncurses and C, and implementation of several commands is requested. One of the commands happens to be chdir, which is meant to change the working directory, however I could not find anything more relevant in C when it comes to changing the working directory besides
linux c: what’s the common use case of “sched_setaffinity” function? I don’t find it useful
The operating system is able to determine how to arrange difference processes/threads onto different cpu cores, the os scheduler does the work well. So when do we really need to call functions like sched_setafficity() for a process, or pthread_setaffinity_np() for a pthread? It doesn’t seem to be able to raise any performance dramatically, if it can, then I suppose we
Redirect the standard output [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 5 years ago. Improve this question Hello and thank you for attention. I am writing my own
Linux userspace header failing to compile with g++
I have a cpp source file in which I have included the following Linux uapi header: #include <linux/netfilter_ipv4/ip_tables.h> I’m using RH6, but the header seems to be identical to the one found in the Linux kernel mainline: http://lxr.free-electrons.com/source/include/uapi/linux/netfilter_ipv4/ip_tables.h The problem is that upon compiling my cpp source file with g++, I’m (obviously) receiving the following error: /usr/include/linux/netfilter_ipv4/ip_tables.h:222: error: invalid conversion