__fpending programming

The __fpending() function returns the number of bytes in the output buffer. For wide-oriented streams the unit is wide characters. This function is undefined on buffers in reading mode, or opened read-only.

On POSIX-compliant platforms, SIGSEGV is the signal sent to a process when it makes an invalid memory reference, or segmentation fault.

#include<stdio.h>
#include<stdio_ext.h>
main()
{
size_t love;
FILE *ptr;
ptr=fopen("home/jeffrin/tester", "w");
love= __fpending(ptr);
 printf("n %p n",love);
}

(gdb) r
Starting program: /home/jeffrin/a.out

Program received signal SIGSEGV, Segmentation fault.
__fpending (fp=0x0) at __fpending.c:24
24 if (fp->_mode > 0)

#include<stdio.h>
#include<stdio_ext.h>
main()
{
size_t love;
FILE *ptr;
ptr=fopen("/home/jeffrin/tester", "w");
love= __fpending(ptr);
printf("n %d n",love);
}

http://www.packetstormsecurity.org/groups/synnergy/dtors.txt