Skip to content
Advertisement

Tag: c++

simple read operating not reading any thing from char device linux

I have a simple code that suppose to read length sized and fetch data from character device in Linux C. This is my code and errno is set to 9. I made sure the file exists and it does. And able to read it with cat /dev/mychardev-0 but why bad file descriptor error at time of read. I am getting

Can we update some object without stopping the program?

There is a program written in C++ and running in linux box. It has a configuration file given to it at starting point. I came to know that it can sometime support updating the configuration file without the need to stop the program. As the configuration update means eventually updating some of the objects(member variables) inside the running program. I

Error while linking static library to test script

I’m building a static library for a small project, and when I compile it with ar, it correctly links. When I go to include the relevant header file and link the test script to the archive; I get linker errors; Running ar t libuttu.a returns My test script includes the main header file, uttu.hpp, which itself refers to the np

Add OpenGL to Linux Vscode

I followed this tutorial successfully. But it doesn’t explain how to configure on vscode. Glad is in this folder /usr/include and I did use sudo in the terminal to compile and generate a.out. How do I do that in vscode? I have this error output when I try to build task: terminal My tasks is configured like that: tasks.json How

How to parse values from a C string into a struct timespec

My program will be receiving C string input in the format of Wed, 21 Oct 2015 07:28:00 GMT, e.g. How to convert this into a struct timespec so I can compare with the st_atim, st_mtim, and st_ctim struct timespec’s returned from the stat() function? This post talks about strptime and sscanf, and I also found strftime, but all these convert

How to correctly time speed of writing to a disk (i.e. file) in C

I have a Zynq SoC which runs a Linux system and would like to time the speed at which I can write to its SD card in C. I have tried out clock() and clock_gettime() where for the latter, I have done the following: The times that I’m getting are around 0.019 seconds for 2097152 bytes which I believe is

Can I use ioread32_rep(addr, buf, 2) to replace ioread64()?

I am currently going through Linux Device Drivers book and found the functions for reading from I/O memory: To read from I/O memory, use one of the following: unsigned int ioread8(void *addr); unsigned int ioread16(void *addr); unsigned int ioread32(void *addr); If you must read or write a series of values to a given I/O memory address, you can use the

Advertisement