Skip to content
Advertisement

Tag: c++

Where do I store dynamically allocated memory on a platform device (without using globals)?

I want to make the platform driver I’m writing reentrant: where do I store memory dynamically assigned during the probe and/or open calls (int probe(struct platform_device*)/int open(struct inode *inode, struct file *)) The driver can be instantiated on multiple pieces of in-system hardware, with each of them being accessed concurrently from user space. Can I use the private_data field from

scons still failed after setup env

I am using scons 1.2 on Centos 5, with devtoolset-1.1, devtoolset-1.1 root path locate at /opt/centoss/devtoolset-1.1/. I added devtoolset binary path to PATH variable, this is what I have everything look good, then I try to make a simple C program using scons I follow the guide at http://www.scons.org/doc/1.2.0/HTML/scons-user/x1673.html setup the env to use os.environ PATH like this, cat SConstruct

What is a .so.2 file?

I compiled Intel TBB from source using GCC. It generates a libtbb.so and littbb.so.2. Looks like the .so.2 file is the real shared library, libtbb.so just contains a line of text INPUT (libtbb.so.2) What is the purpose to generate these two files instead of one? For the INPUT (libtbb.so.2), what is the syntax? I want to know more about it.

Does Clang/GCC really support a delay loading feature?

Would you mind to leave your comment on this if you have really experienced which relates to the title above? I have tried to make a shared object to be delay loaded with both Clang and GCC on Ubuntu (I actually don’t mind which compiler is used), but they do not look really support any delay loading feature (I expected

Using CLOCK_PROCESS_CPUTIME_ID in clock_gettime

I read http://linux.die.net/man/3/clock_gettime and http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-681578 It said to use this to measure how long it take for a function to run. I tried that in my program. When I run it, it returns saying it took 15 sec. But when I compare against using a stop watch to measure it, it is 30 sec. Can you please tell me why

Invalid conversion from ‘FILE* {aka _IO_FILE*}’ to ‘int’

When trying to compile this little example… …I get a compiler error regarding the call to lseek(). The output is: For the record: I have also tried using both lseek(*foo, 5, SEEK_CUR); and lseek(&foo, 5, SEEK_CUR);, but that only makes things worse. (I really didn’t expect that to solve anything either.) Referring to the man-page for lseek(3): Synopsis off_t lseek(int

Advertisement