A question of stack size when using fopen(); - VxWorks

This is a discussion on A question of stack size when using fopen(); - VxWorks ; I use fopen("filename", flags) in a task with stack size 5K,but 1. if the "filename" exist, the free stack size of the task is 3904 bytes. 2. if the "filename" doesn't exist, the free stack size of the task is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: A question of stack size when using fopen();

  1. A question of stack size when using fopen();

    I use fopen("filename", flags) in a task with stack size 5K,but
    1. if the "filename" exist, the free stack size of the task is 3904
    bytes.
    2. if the "filename" doesn't exist, the free stack size of the task is
    2672 bytes.

    why?


  2. Re: A question of stack size when using fopen();


    "lixingfu2003@gmail.com дµÀ£º
    "
    > I use fopen("filename", flags) in a task with stack size 5K,but
    > 1. if the "filename" exist, the free stack size of the task is 3904
    > bytes.
    > 2. if the "filename" doesn't exist, the free stack size of the task is
    > 2672 bytes.
    >
    > why?



    I know the reason!
    The stack consumption is brought by the fprintf()!
    when the "filename" doesn't exist, i use fprintf().
    why?


+ Reply to Thread