Skip to content
Advertisement

Tag: c++

how to interpret pclose() status when popen() fails?

My application running on embedded linux (busybox) tries to execute a script via popen(cmd, “r”). cmd = “sh /tmp/DF1_05/update.sh DF1_05” I can execute this script without problem launching it by hand from sh, but it fails when it’s launched by the application. The first lines of update.sh script are: I cannot even see the echo ouput. My application’s code is:

Is there a way to lookup refcount for a kobject?

I expected to find a function along the lines of kobject_check_refcount, that returned the current refcount without altering it, in kobject.c, but as far as I can see there isn’t one. Is there such a function existing in the kernel source somewhere? I can see it being useful for debugging purposes at points. Edit: found kref_read which sounds like it

init function not present in kallsyms

I wrote a simple hello world kernel module After loading the module, i am checking what all symbols are added into /proc/kallsysms. I don’t observe test_hello_init. Why don’t we have it Answer Using Linux kernel 5.8 source as a reference, the module’s symbol table for “kallsyms” is set up by the call to add_kallsyms() (in “kernel/module.c”) at module load time

How to select the interface used to perform a hostname lookup

I am working in an application embedded in a device running Linux and BusyBox. The hardware has 2 communication interfaces: Wi-Fi and 3G. In each connection, the application must try to connect using wi-fi first and, if it fails, the application tries again using 3G. I am forcing the connection to use the selected interface binding it like this: But

Linux SocketCAN behaviour of recvmsg

I’m writing a CAN logger program. The way I log the data is similar to the way the candump-tool is doing it when invoking candump like candump any: https://github.com/linux-can/can-utils/blob/master/candump.c candump any makes candump bind to any device, i.e. addr.can_ifindex = 0; then it uses recvmsg to obtain a CAN frame, then it gets the on the struct msghdr msg; attached

Pipe between a C and a Python program

I am currently trying to write a C program that interacts with hardware, I have chosen so since the manufacturer of the hardware supplies with a C SDK for this hardware. However, I want this C program to output the data it receives from the hardware (a sensor for example) to a pipe so that I can write a Python

DBus rejecting to send message to a custom service on the system bus

I’m writing a chatbot that (besides other features) allows the admin to send custom message to instant message apps via a DBus call. The chatbot creates a service org.cdpa.cdpachan on the system bus, exposes the interface org.cdpa.bot_send_message and the method send_message. I’m able to get any user to register the service name with the configuration file /usr/share/dbus-1/system.d/org.cdpa.cdpachan.conf But sending DBus

Advertisement