Hello everybody!
In the past months I acquired good C programming skills and now I'd like to make a step further and learn well C++ (if possible using MS Visual C++ environment).. I can already...
Type: Posts; User: smoking81
Hello everybody!
In the past months I acquired good C programming skills and now I'd like to make a step further and learn well C++ (if possible using MS Visual C++ environment).. I can already...
Hello there!
I hope you can help me with this since I'm going to get crazy...
I'm trying to read and understand the radix tree code (lib/radix.c) but although in theory it's very clear the way...
hello everybody!
i am a bit confused about the way the flags and masks defined for st_mode have to be used..
Suppose that I lstat-ed a file and want to retrieve first is permission in numeric...
hello everybody! I have one doubt.. Can free() be used with a casted pointer? My situation:
I have these 2 structs which implement a doubly-linked list:
struct list_head{
struct list_head...
I mean: suppose that I want to terminate a loop like this
while (1)
{
pause(); //stop until you receive any signal
if (I_received_a_sigterm)
break;
}
nobody can help me? :( Please...
I was thinking: what if I want the clone to be aware that he is exactly the recipient of the SIGTERM? Could I set the global variable with its pid and check this in the while()?
thanks! Bye
with a normal list i'd do this in a couple of minutes, but with this list_head struct I have some problems.. every node has 2 pointers, the last has to point to head which in turn has to know who is...
Hello everybody!
This is a quite good exercise for training with pointers: so good that I'm getting crazy!:)
In linux, a doubly-linked list is implemented by means of a list_head structure...
thank you CornedBee! without this forum i'd be dead! :)
Which is the difference between volatile sigatomic_t and volatile int? I had to use the second since siatomic_t didn't compile.. Which library...
hi!
I invented another exercise to train with signals...
The text sounds like this:
The program receives from the command line a string and a list of directories (1 or more).
The father...
Finally I found out the problem: open on a FIFO is blocking as well as read and write.. So I caused a deadlock which could be avoided simply opening the files in the same order.. This lead me to...
Hello again! I finally tried to write another version of the program using FIFOs instead of locks and the result is this program which doesn't work.. It seems like if there is a deadlock somewhere,...
thanks matsp! :)
Hello!
Supposing that I have to deal with double linked lists in user space and I don't want to reinvent the wheel, how can I use the functions and macros defined in /linux/list.h and then avoid to...
so we can say that the only way we can force a clone to parse 1 byte per time is to force the sleep, is that right? :)
the same mind who wrote this book...
Hello everybody!
Today I wanted to solve this exercise:
A main process opens a file (filled with bytes in the range 0-255) and then creates 2
clone processes which have to parse (of course in...
Hello everybody! I have a small doubt about signals which hope can find an answer here! :) What I need is just a confirmation or denial of my understanding of what follows...
In general, when we...
I am looking for the same stuff: I found this which looks nice! http://www.eng.hawaii.edu/Tutor/Make
bye
Hi again!
Reading again and trying to understand better your answer I pointed my browser to http://gcc.gnu.org/onlinedocs/gcc/
I didn't find __attribute_used__ there but your explaination is...
I'd replace
char filename[ strlen(szbuf)];
with something like
char *filename;
size_t len=strlen(szbuff);
filename=(char *)malloc(sizeof(char)*(len+1)); //sizeof(char)=1, i put just to...
thanks a lot Mats!
of course your guess is correct: I am studying modules right now! :)
so we can say the answer is:
static initcall_t __initcall_fn6 __attribute_used__ __attribute__((__section__(".initcall6.init"))) = fn
?
in general, when is the use of "__" advised?
thanks...
when you call three_powered(4):
power<1? NO -- > return 3*three_powered(3);
three_powered(3) --> return 3*three_powered(2);
three_powered(2)--> return 3*three_powered(1);...
hello everybody!
I am trying to understand some code of linux but i am not 100% able to understand preprocessor's directives and programming conventions...
here is the code i want to understand:...