Skip to content
Advertisement

Tag: c++

Sockets – keeping a socket open after data transfer

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

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

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

Advertisement