Re: fork function fails with error code 89

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2 Feb 2007, Sivakumar Jayapal-TLS,Chennai. wrote:

I have a XFree86 cross compiled for SH4 Renesas that is using QNX as
operation system
We have modified the XTrans completely to support Firewire (IEEE 1394)
network. This XTrans modified (to work with threads) XFree86 was tested
on X86 PC and found to be working fine. The same frame when tried
executed from QNX, the fork fails and XTerm doesn't show up.
The analysis confirms that threads are being created before the fork
call is made and hence the fork fails. We substituted fork with Spawn,
but the process id wasn't the same as the parent process.
We tried changing the functions calling order that create threads after
the fork is called, in this case the X comes up but it doesn't show the
XTerm or allow mouse, keyboard support.
What could be a solution for this?

If I understand you correctly, the problem is that the OS the client (say xterm) is running on does not allow a thread to fork. If that is so, there's very little I can suggest other than not to use threads. For reference, POSIX says ...

"A process shall be created with a single thread. If a multi-threaded process calls fork(), the new process shall contain a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal-safe operations until such time as one of the exec functions is called. Fork handlers may be established by means of the pthread_atfork() function in order to maintain application invariants across fork() calls."

Marc.

+----------------------------------+----------------------------------+
|  Marc Aurele La France           |  work:   1-780-492-9310          |
|  Academic Information and        |  fax:    1-780-492-1729          |
|    Communications Technologies   |  email:  tsi@xxxxxxxxxxx         |
|  352 General Services Building   +----------------------------------+
|  University of Alberta           |                                  |
|  Edmonton, Alberta               |    Standard disclaimers apply    |
|  T6G 2H1                         |                                  |
|  CANADA                          |                                  |
+----------------------------------+----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.
_______________________________________________
XFree86 mailing list
XFree86@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/xfree86

[Index of Archives]     [X Forum]     [Xorg]     [XFree86 Newbie]     [IETF Announce]     [Security]     [Font Config]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux Kernel]

  Powered by Linux