This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
Need Clarification: Debugging EBADF occurance
- From: "Rajanikanth H.V" <rajanikanthhv at gmail dot com>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 8 Jan 2010 13:28:17 +0530
- Subject: Need Clarification: Debugging EBADF occurance
Hello,
I am debugging glibc for a sample fifo application having independent
reader/writer.
Application crashes with EBADF error number after few hours(between 2 - 6 hrs)
of application being run,
Navigating the libc code, i see, EBADF is set during:
ÂÂÂÂÂÂÂÂÂÂ - Attempt to read on NO_READ Â permission
ÂÂÂÂÂÂÂÂÂÂ - Attempt to write on NO_WRITE permission
This check happens in underflow/overflow function as:
Âif (fp->_flags & _IO_NO_READS)
{
Âfp->_flags |= _IO_ERR_SEEN;
Â__set_errno (EBADF);
Âreturn EOF;
}
I want to know where and why NO_ERAD/NO_WRITE flag is set?.
Note:
ÂÂÂÂÂÂÂ -Â I am using fread/fwrite and fifo us created using mknod (...).
ÂÂÂÂÂÂÂ -Â Platform : ARM Board with linux kernel version 2.6.29
Thanks in advance.
Regards,
Rajanikanth