Search:

Type: Posts; User: smoking81

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds; generated 34 minute(s) ago.

  1. Replies
    5
    Views
    4,166

    Moving form c to c++

    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...
  2. Replies
    0
    Views
    1,666

    need help with the radix tree functions

    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...
  3. Replies
    1
    Views
    3,605

    using lstat st_mode flags

    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...
  4. Replies
    3
    Views
    1,340

    using free with a casted pointer..

    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...
  5. Replies
    10
    Views
    4,130

    I mean: suppose that I want to terminate a loop...

    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;
    }
  6. Replies
    10
    Views
    4,130

    nobody can help me? :( Please...

    nobody can help me? :( Please...
  7. Replies
    10
    Views
    4,130

    I was thinking: what if I want the clone to be...

    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
  8. Replies
    4
    Views
    3,666

    with a normal list i'd do this in a couple of...

    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...
  9. Replies
    4
    Views
    3,666

    sorting a doubly linked (linux-style) list

    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...
  10. Replies
    10
    Views
    4,130

    thank you CornedBee! without this forum i'd be...

    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...
  11. Replies
    10
    Views
    4,130

    hi! I invented another exercise to train with...

    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...
  12. Replies
    6
    Views
    1,923

    Finally I found out the problem: open on a FIFO...

    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...
  13. Replies
    6
    Views
    1,923

    Hello again! I finally tried to write another...

    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,...
  14. thanks matsp! :)

    thanks matsp! :)
  15. using functions and macros defined in include/linux/list.h

    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...
  16. Replies
    6
    Views
    1,923

    so we can say that the only way we can force a...

    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...
  17. Replies
    6
    Views
    1,923

    syncronization issue

    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...
  18. Replies
    10
    Views
    4,130

    A question about signals handling

    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...
  19. Replies
    3
    Views
    3,125

    I am looking for the same stuff: I found this...

    I am looking for the same stuff: I found this which looks nice! http://www.eng.hawaii.edu/Tutor/Make
    bye
  20. Replies
    18
    Views
    3,171

    Hi again! Reading again and trying to...

    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...
  21. I'd replace char filename[ strlen(szbuf)]; ...

    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...
  22. Replies
    18
    Views
    3,171

    thanks a lot Mats! of course your guess is...

    thanks a lot Mats!
    of course your guess is correct: I am studying modules right now! :)
  23. Replies
    18
    Views
    3,171

    so we can say the answer is: static...

    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...
  24. when you call three_powered(4): power...

    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);...
  25. Replies
    18
    Views
    3,171

    understanding c preprocessor directives...

    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:...
Results 1 to 25 of 100
Page 1 of 4 1 2 3 4