Skip to content
Advertisement

Tag: c++

When using PF_PACKET type of socket, what does PACKET_ADD_MEMBERSHIP?

When using a PF_PACKET type of socket with protocol type ETH_P_IP, the man packet documentation talks about a socket option for multicast. The socket option is PACKET_ADD_MEMBERSHIP. Assuming you use PACKET_ADD_MEMBERSHIP socket option on a PF_PACKET socket correctly, what features and benefits and use cases is this socket option for? Right now I receive all incoming IP packets so I

Make is unable to find the functions

I am trying to compile a C program, while linking the APR library. I am getting the following error message: cc -g -Wall -pthread -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-util-1 -L/usr/local/apr/lib -L .aprutil-1 -L .apr-1 devpkg.c bstrlib.o db.o shell.o commands.o -o devpkg /tmp/cczC53x5.o: In function `main’: /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:14: undefined reference to `apr_pool_initialize’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:15: undefined reference to `apr_pool_create_ex’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:29: undefined reference to `apr_getopt_init’ /home/yotam/Dropbox/Development/C/devpkg/devpkg.c:31: undefined reference

How does kbuild actually work?

When i’m developing a linux driver, i’ve read about how to write linux kbuild makefile through this document I know kbuild system use makefile variables such as obj-y obj-m to determine what to build and how to build. But what i’m confused about is where does kbuild system really execute build process.In a word, if i have obj-m = a.o,

C++ std::thread “Attempt to use a deleted function”

Here’s the relevant code and the relevant error, I’m not really sure what to make of it. That’s in thread.cpp, the next is in log.cpp… and Here’s the relevant error: Answer I think the problem is the declaration of the parameter func. It is declared as a void pointer instead of a pointer to a function returning void. Instead of,

troubles linking boost statically to shared objet on linux

I am using Boost 1.57.0 I compiled it with the following command When I compile shared library to where I want to link boost statically I got the following error What I am doing wrong? I am on x86_64-linux-gnu. Answer We use this script to build boost statically and do build shared libs from it afterwards: The compiler flags we

Remap a keyboard with ioctl under linux

I am actually trying to write a small program to catch global keyboard inputs from specific USB keyboards under linux. I am testing with this piece of code : Ths point is that I don’t know how to change some input key by other. I tried by calling write() on currently red event by changing the event code, sent key

C: strtok and newlines in Windows vs Linux

I’m working on a C school assignment that is intended to be done on Windows, however, I’m programming it on OS X. While the other students working on Windows don’t have problems reading a file, I do. The code provided by the tutors splits the contents of a file on n using this code: However, the file adfgx.txt (which is

Not able to open a message queue in read mode (mq_open())

I have a program which creates a message queue and send a message (with mq_send()) to this queue. then I try to open the same message queue to read the message from another process. But mq_open() returns -1. open_and_write_MQ.c This creates the MQ. Below program tries to read the same MQ. open_and_read_MQ.c Compilation steps: execution steps: then run below program

Advertisement