Programming :: Kernel API *get_super (struct Block_device *bdev) Producing Error With Fedora Core 5
Feb 2, 2011
I understand that block_device pointer *bd sholuld get initialized. Program should produce initialization error for *bd. Compiler is producing '->'. I am not understanding why?
[code]...
View 1 Replies
ADVERTISEMENT
May 1, 2010
This for Kernel 2.6.29.6. I'm trying to code a kernel module that displays process information.
how to count opened file descriptors per task. I have been able to write a module that lists all the current process names along with their pid number in /var/log/messages. Basically, I cycle through the ring of processes using the macro for_each_process(task) and printk the comm and pid of each task. I'm trying to see how many file descriptors each task has open. I've been reading up in books and all over the internet. At first I thought I needed to access max_fds under files_struct, but that just lists the maximum number of file descriptors that can be opened per task, which by default is set at 256. I then thought about counting the elements in the fd_array. But then I learned that every task's fd_array is initially set at 32. Now I know that I need to access open_fds of type fd_set * in files_struct. open_fds is a pointer to all the open file descriptors. The problem is that I don't know how to access a pointer of type fd_set.
Is there a good guide or book that really focuses on type fd_set and open_fds? Every book and resource I've read never really go into depth on this. relationship between files struct, open_fds, and the open file descriptors in task?
View 4 Replies
View Related
Aug 3, 2010
My system has Intel Xeon 4-core cpu(hyperthreading 8-core) and run 64-bit linux. I want to allocate one core for general process(kernel process & other processes). And then, I want to allocate the rest of core for the specific multi-thread program.
Q1: I know that I can pthread_setaffinity() for user-mode thread and mpstat for monitoring. So, how can I allocate a core for kernel process and monitor it?
Q2: How can I restrict use of the cores for the multi-thread program? I don't want kernel process to use the cores for the multi-thread program.
View 1 Replies
View Related
Mar 24, 2011
Just a heads up. I just found out about a free online book called Producing Open Source Software. It's great.
I just used a trunk checkout and the directions here to make myself an epub version:
[url]
EDIT AGAIN: don't download the epub version from here:
[url]
If you get it there, then the table of contents doesn't work. Make the epub version yourself, and you have a table of contents.
View 5 Replies
View Related
May 23, 2011
I have an old C application in which i am trying to include some STL cointainers. When i use the STL container alone it works fine, but when i include it into a C struct i have segmentation faults errors. I know that it is not a good idea to mix C and C++. Considering this code:
Code:
typedef struct{
int shmid;
...
APPLSPACETYPE applSpace;
[code]...
and how to make a malloc for this issue; something like :
Code:
mem->applSpace.rData.completeGroups2zeroGroup=(map_completeGroups2zeroGroup_type *)malloc((sizeof(map_completeGroups2zeroGroup_type)+1)* sizeof(char ));
View 11 Replies
View Related
Apr 8, 2011
Is is possible to use a class inside a struct? I keep getting segmentation fault with this code:
Code:
struct my_struct {
unsigned count;
std::string msg;
[code]....
View 3 Replies
View Related
Nov 6, 2010
I have been spending time (starting yesterday) reverse-engineering GTK+ to get my programming skills up. I came across a struct in the headers (_GtkArg, which was then typedeffed into GtkArg) that includes a union in it that has pretty much the same properties as a struct. Then, there was a struct inside the union.
I'm confused. Just what is the difference between a union and a struct?
P.S. I am using GTK's native C programming language.
View 8 Replies
View Related
Mar 30, 2010
How do we allocate memory of struct? what i did was
Code:
int main()
struct amp
{
[code].....
cout <<"The size of 'struct' is"<< sizeof(struct amp)<<"and it is located at"<<struct amp*s = malloc(sizeof(struct amp))<<endl;
it gives me an error---
In funtion 'int main()':
error: expected primary-expression before 'struct'
error: expected ';' before 'struct'
View 9 Replies
View Related
May 14, 2010
For a work project, I've got a bunch of python code from about a year ago that controls the movement of our EVI-D30 camera over a ttyUSB connection. It used to work fine on a 32-bit Fedora box, but recently we moved our whole project over to a 64-bit Gentoo server, and the same code seems to be worthless on the new platform. I didn't write the code, so I'm have trouble figuring out how to fix it. Error messages usually look like this:
Code:
File "./CameraController.py", line 172, in pan
turn_callback(cmdStruct[0], cmdStruct[1])
File "./CameraController.py", line 147, in turn_callback
cameras[camera].TiltUp()
[code]....
View 13 Replies
View Related
Jan 17, 2011
is there any problem that might rise by by having a vector as a member of struct in c++ as follows.ex.
struct A
{
int a;
[code]...
View 2 Replies
View Related
Mar 11, 2010
I having a nested structures which are referenced with pointer variables :
example :
typedef struct {
int a ;
char *b ;
int *c ;
}EXP2 ;
[Code]...
While trying to access the value of sv.exp2->a it throws segmentation fault error.How to acess this variable ??
View 3 Replies
View Related
Oct 31, 2010
Is there any Linux API that will let me control on what core will a thread run? If not, do I have to use assembly language?
View 2 Replies
View Related
Jul 2, 2010
I following structure
typedef struct
{
[code]...
View 5 Replies
View Related
Feb 5, 2011
I have what should be a relatively simple program (fadec.c) that maps a struct from an included header file (fadec.h) to a shared memory region, but Im struggling accessing members in the struct from the pointer returned by shmat. Ultimately, I want to access members in the shared memory structure with a globally declared version of the struct, shm__. Not only do I not know how to accomplish that, but I cant even seem to access members of the shared struct directly from the pointer itself (compiler complains about dereferencing pointer to incomplete type). Im at a loss and could use another set of eyes if you guys dont mind taking a gander:
Compile Errors:
tony-pc:/cygdrive/p/test> cc -o fadec fadec.c
fadec.c: In function 'main':
fadec.c:30: error: dereferencing pointer to incomplete type
fadec.c:31: error: dereferencing pointer to incomplete type
[Code]...
View 1 Replies
View Related
Jun 2, 2010
int GetTime(struct timeval tv)
{
gettimeofday(&tv, NULL)
printf("%d
", tv.tv_sec); /* here is the right value */
return 0;
}
[Code]....
What happend? struct timeval has a self timer?
View 3 Replies
View Related
Apr 27, 2010
Assume someone bind a particular process to a particular CPU core(In multi core machine) by using sched_setaffinity() like functions. Then how we can get that process running core id and CPU core utilisation of that process on that running CPU core(Pragmatically or by a Linux command)?.
View 5 Replies
View Related
May 26, 2010
Is it possible to create a global struct variable with predefined member values?Only one instance of that struct is ever needed.
View 1 Replies
View Related
May 3, 2010
I want to read a pressed key or a combination of pressed keys from the keyboard and perform some action afterwords.
e.g.
Ctrl-Alt-F1
Out of ncurses lib. and the termios struct which can be used best for the above purpose and why ?I tried to search on Google, the differences between these two but couldn't get much !
View 6 Replies
View Related
Aug 19, 2009
Where can I find the vmlinux file corresponding to my current running fedora core 10 kernel? I find only vmlinuz file in /boot
View 5 Replies
View Related
Dec 20, 2010
I plan to install PHPUnit in Fedora Core 12 pc. But I cannot, I already use all YUM commands Regarding this.
View 4 Replies
View Related
Oct 7, 2009
I want to generate core dump files from my program when it crashes. Its a pretty big process and has about 10-11 threads in it.I have followed the documentation to enable core dump by setting ulimit to unlimited etc. I quickly tried "A demo program creating a core dump" from the following webpage, which succeeds in Segfault and dumping a core file in the directory that I configured.However, I tried running my original program and caused it to crash. I did this by making calls to kill(), raise() or the same null pointer access as shown in the webpage above. In each case, my program crashed but did not generate a core dump file. Am I missing something?My program is in C++ and my environment is Redhat 9.0 (kernel 2.4.20)
Going through the "Why do I NOT get a core dump?" section on the same webpage as above, I can see two potential problems. One - there are issues with the suid/sgid (bullet # 6). I am not able to change any settings with suid because my system does not contain either /proc/sys/fs/suid_dumpable or /proc/sys/kernel/suid_dumpableTwo, my program has threads in it and the bullet # 8 is the problem.
View 1 Replies
View Related
Jan 18, 2010
I did a horrible mistake due to lapse in my concentration. Here is the 80 GB IDE disk geometry:
=> C: Windows XP SP2 15 GB partition
=> D: NTFS parition - 10 GB
=> E:F:G:H: NTFS partitions on the Windows Extended partition.
=> On the same Extended partition, there exists Linux /swap and /root partitions.
What happened was:
a) I wanted to delete the H: parition which was residing adjacent to Linux partition
b) By mistake I opened the Explorer and clicked the Mouse on H: partition and left it like that (forgot)
c) I opened Add/Remove program list but did nothing, to do few uninstalls after partition deletion.
d) Now I opened compmgmt.msc for Disk Management then deleted the H: partition!
Then XP reacted strangely and got almost hung
e) Then I switched OFF and ON the PC.
f) Most shocking was GRUB screen vanished (crash console appears) which means that Linux partition got deleted instead of H: partition!!
It's important to share with you that Fedora Core 12 possess the default BOOT flag. I thought that it's nothing big deal, only a case of Boot flag toggle with DOS bootable CD but am shell shocked to find after hitting the fdisk from DOS it says Error reading the disk!!! I felt like collapsed for a while, don't know how I did such a mistake. how to boot into my Windows XP. I can't afford to loose data or bear the expense on Data recovery
View 14 Replies
View Related
Nov 24, 2009
i recently installed the banshee media player using yum extender. Everytime i run it i get this error " a crash in mono-core-2.4.2.3-2.fc12 has been detected" how can i fix this problem?
View 2 Replies
View Related
Jul 6, 2010
When I compile a C program in Fedora Core 12 using the following format: gcc -o program -static program.c
I get an error:
What do I need to do to make the program compile correctly with the -static flag ?
View 1 Replies
View Related
Mar 14, 2010
i download the rpm package of gcc .
View 10 Replies
View Related
Jun 20, 2011
I am using RHEL 6. When i use CAP3 software for the first time it successfully resulted. But second time when i used, it's showing "segmentation fault (core dumped)". Even after restarting and reinstalling it showing same error. When i google, i found it some memmory related problem. But no clear information.
View 3 Replies
View Related
Nov 3, 2010
I just loaded F14 on an old Dell Dimension 3000 with a dual core processor but only one is showing. Here's the output from top:
processor: 0
vendor_id: GenuineIntel
cpu family: 15
model: 4
[Code]....
View 2 Replies
View Related
Jan 7, 2009
installing on linux i try to install VLC and get [user@localhost ~]$ sudo yum install vlc Setting up Install Process Parsing package install arguments Resolving Dependencies
--> Running transaction check
---> Package vlc.i386 0:0.8.7-0.8.fc8 set to be updated
--> Processing Dependency: vlc-core = 0.8.7-0.8.fc8 for package: vlc
[Code]...
View 3 Replies
View Related
Nov 25, 2010
I use iptables firewall (v1.4.1) installed on FC8. I'm trying to limit the inflow traffic for the port 1723 to certain MAC addresses. To experiment with the mac option, I've written the following iptables rule:
Quote:
iptables -A INPUT -m -mac --mac-source 10:08:08:08:08:10 -j ACCEPT
It didn't work. It gave me this error message:
Quote:
iptables v1.4.1: Couldn't load match `-mac':/usr/local/libexec/xtables/libipt_-mac.so: cannot open shared object file: No such file or directory
Try `iptables -h' or 'iptables --help' for more information. Does that mean the mac module wasn't installed/enabled?
View 4 Replies
View Related
Dec 28, 2010
I am trying to include a QWebView widget in my application. Every time I try to compile it, I just get these errors:
Code:
$ LANG=en_US make
g++ -c -pipe -O2 -march=i486 -mtune=i686 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -
[code].....
View 1 Replies
View Related