Re: XForms: How to detect fl_initialize in a spawned process?

Steve Lamont (
Wed, 13 Aug 97 20:53:09 PDT

To subscribers of the xforms list from (Steve Lamont) :

> I have a program which needs to be either spawned off the main program, or
> it can be run standalone. ...

How is the program spawned? With fork() and exec()? Although I
believe the file descriptor for the server connection is generally
marked "close on exec," it may not be in your version of Xlib -- you
might try the following:

#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>


if ( fork() == 0 ) {

int fd = ConnectionNumber( fl_get_display() );
int flag = fcntl( fd, F_GETFD, NULL );

if ( FD_CLOEXEC & flag )
close( fd );

execve( ...

What is the error message you are getting? This information is always

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: