Unix Programming - Can not open a device file in /dev/ after in child process

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2006 > Can not open a device file in /dev/ after in child process





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Can not open a device file in /dev/ after in child process
Max

2006-05-17, 1:16 pm

Hi,
I am facing a typical problem. In between one of my programs I need to
fork() a child process and in that child I need to open a device file
in /dev/. I wrote the code when I try to run it I find that that file
can not be opened. But if I just comment out the fork() portion and
simply open it I can open.
I can not understand what is happenning. Can any body help me to solve
this problem ??
Regards
Andi

Chuck Dillon

2006-05-17, 1:16 pm

Max wrote:
> Hi,
> I am facing a typical problem. In between one of my programs I need to
> fork() a child process and in that child I need to open a device file
> in /dev/. I wrote the code when I try to run it I find that that file
> can not be opened. But if I just comment out the fork() portion and
> simply open it I can open.
> I can not understand what is happenning. Can any body help me to solve
> this problem ??
> Regards
> Andi
>


"can't open" isn't very informative. If you want help don't withhold
information. What makes you think you can't open it? If open is
failing what is the system telling you? Once you understand what it is
telling you if that doesn't lead you to a solution then post all you
know (i.e. what specifically is the file, what does open return, what
error do you get) when you ask for help.

HTH,

-- ced

--
Chuck Dillon
Manager of Software Development, Bioinformatics
NimbleGen Systems Inc.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com