I’m learning how to use sysfs in my Linux modules, but I’m having the hardest time finding current documentation on these topics. The Linux Device Drivers 3rd Edition book I’ve been using seems to be rather dated in this area unfortunately (e.g. the class_device structure appears to be completely gone in current Linux versions). I’m simply trying to get an
Tag: c++
Calling assembly routines from C source code
I have this simple C source code : and i have this s.asm which defines the function _Sum : now , i compiled the .asm using : and compiled and linked the .c file using : this is the outcome : So what is the problem ? I’m using Ubuntu-Linux Any help would be greatly appreciated , Thanks [SOLVED] :
Unable to run compiled files – bash: ./a.out: Permission denied. (I’ve tried chmod)
I’ve compiled my C source using cc test.c, and it did generate a.out file. However when I run it I get this error – My source is not in the home directory, it is on different FAT-32 partition, so I’ve mounted the drive in which the code is using the following command – Then I compile my code using cc
Physical disk block size on POSIX using C/C++
I’m working on a high performance I/O program and I’m trying to find the best way to determine the _physical_ (and not the _logical_) byte size of a device’s disk blocks with C++. My research so far has led me to the following code snippet: The man pages says the following about st_blksize: The st_blksize field gives the “preferred” blocksize
C code with ncurses compiled with libtinfo dependency
I’ve recently written a minesweeper implementation in C using ncurses on linux; everything works fine on my pc, but if I try to give the compiled binaries to someone else they often get the error: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory If I have them recompile the code everything’s fine.
Sending signal to pthread to abort sleeping
I’m have a pthread function, which sleeps most of the time using usleep() I would like to send a signal from the main process to the thread to interrupt the sleeping sometimes. The problem is that I can’t find any reference of which signal exactly to send using pthread_kill() the usleep() man page, states that SIGALRM should not be used
how to give more than one c file as input to GNU Cflow?
I was able to generate the callgraph of one file using gnu – cflow, but I was not able to find out how to generate the call graph for multiple files using cflow. I tried following cflow test.c,hello.c It generates the callgraph for test.c and not creating it for hello.c cflow test.c hello.c It generates the callgraph for hello.c and
connect() returns “Operation now in progress” on blocking socket?
I have a blocking socket (at least it appears so in following code): And this is from log: Mar 6 10:42:04 tcpclient: fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:04 tcpclient: after select fcntl ret=0, ret & O_NONBLOCK = 0 Mar 6 10:42:14 tcpclient: authenticate: error on connect -> Operation now in progress It appears this is a
Netbeans 7.2 shows “Unable to resolve identifier” , although build is successful
I’m using the Netbeans IDE 7.2 with C/C++ plugin (last version 1.18.1.1) and if I build my project everything is fine but the IDE show me errors (e.g. unable to resolve identifier …) Anyone else have this bug and how can I solve it? Answer Here’s an excerpt from my answer to another question. Unresolved Identifier If the source of
Mutex lock threads
Am new to multi threaded/processs programming. So here’s what I need to clarify. Process A code With the above pseudo code, is process B able to access sharedResource if mutex is not unlocked? How can I access the sharedResource from process B correctly? Any there any clear visual diagram that explains the relationship between mutexes, threads and processes? Answer What