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
Tag: c++
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
Why am I not able to use relative path to open a file in CLion?
I seem to get errors when trying to open an std::ifstream if I use a relative path. Though it works fine if using an absolute path. Is there something I need to add to the CMakeLists.txt? (I’m pretty new to using cmake) Or is it just a problem in CLion? Answer It’s CLion. You have to set the Working Directory
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,
linux kernel module: kernel method undefined (kthread_create_on_cpu)
The method is defined in kthread.c file and prototyped in kthread.h. But it is not exported. In my driver I want to start a kthread on a given CPU, so I do: I can compile but I get linkage error on resolving module symbols on MODPOST: How should I proceed? How to import this symbol or what to do instead?
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