1833783 Members
2326 Online
110063 Solutions
New Discussion

accept call giving EBADF

 
Sajeev V
New Member

accept call giving EBADF

HP-UX B.11.00 U 9000/800
accept() system call when called within a thread is giving EBADF. The same program works fine when called by a single threaded program.
Even the same threaded program is working fine on a different machine(HP-UX, same config)
Is there any patch to be applied?
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: accept call giving EBADF

Does the thread have its own socket? Can you post a code sniplet?

live free or die
harry
Live Free or Die
Wodisch
Honored Contributor

Re: accept call giving EBADF

Hello,

do you use user-level or kernel-level threads?
The former have to use "jacket-routines" to protect most system-calls (like "accept") from being not "thread-safe"...

- Have a look at your "swlist" output: are the "DCE kernel level threads" installed?
- Check your "Makefile": which include-dirs and -files and linker-options do you use?

Be careful, as there are many *flavours* of threads today, so it depends on which you want to use, for which you compile and link, and which your system actually uses!

Just my $0.02,
Wodisch
Sajeev V
New Member

Re: accept call giving EBADF

Hi Wodisch/Harry,

Thanks for the prompt reply.

I have seen the swlist. I didn't find any "DCE kernal level threads" installed. As i had said earlier, the same program is running on a similar machine. There are many patches installed on both machines, maybe the sequence differ.

Code is attached.

Thanks
Sajeev V