Re: [PATCH] Haiku port with GUI

François Revol <[email protected]> Mon, 23 Dec 2013 01:47:54 +0100
Newsgroups gmane.editors.qemacs.devel
Message-ID <[email protected]>
On 23/12/2013 01:34, François Revol wrote:
> Hi Charles,
> 
> On 17/12/2013 15:34, Charles Gordon wrote:
>> Hi Francois,
>>
>> Thank you for this patch, I will commit it to the repository soon.
>> I played with Haiku to check that it compiles and I noticed the process
>> buffer does not work at all.  There seems to be a problem with the pseudo tty logic we use to
>> set up the communication between the process and the qemacs terminal emulator.
>> I haven’t investigated this issue in depth.  Has this feature ever worked in Haiku ?
> 
> I've look at it, and comparing with our Terminal application sources at:
> http://cgit.haiku-os.org/haiku/tree/src/apps/terminal/Shell.cpp#n464
> it seems we call setsid() before actually opening the tty.
> 
> I've moved the call before in qemacs and it just works.
> 
> I'm not sure if it's either our implementation which is broken or if
> it's not supposed to be in this order and it's just Linux and others
> which accept it anyway...

At least netbsd's daemon seems to call it before even closing the old tty:

http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/xsrc/xfree/xc/programs/xdm/daemon.c

The opengroup page for setsid() isn't very explicit. This one isn't much
more either though, it seems most relevant things are "implementation
specific" (why write specifications then...):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/xbd_chap11.html

François.