From owner-freebsd-current Thu Feb 19 22:03:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA22169 for freebsd-current-outgoing; Thu, 19 Feb 1998 22:03:19 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from starbase.spd.louisville.edu (root@starbase.spd.louisville.edu [136.165.99.61]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA22141 for ; Thu, 19 Feb 1998 22:03:14 -0800 (PST) (envelope-from vegold01@starbase.spd.louisville.edu) Received: from moose.mindspring.com (user-38lc2ri.dialup.mindspring.com [209.86.11.114]) by starbase.spd.louisville.edu (8.7.6/8.6.12) with SMTP id BAA06002; Fri, 20 Feb 1998 01:03:08 -0500 (EST) Message-ID: <34ECD591.41C67EA6@starbase.spd.louisville.edu> Date: Fri, 20 Feb 1998 01:00:01 +0000 From: "V Edward Gold, Jr." Organization: GoldTouch Computer Solutions X-Mailer: Mozilla 3.0 (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: freebsd-current@FreeBSD.ORG Subject: problems with XView and FreeBSD Content-Type: multipart/mixed; boundary="------------446B9B3D2781E494167EB0E7" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I just recently started playing with an application that was written originally on SunOS 4.1.3 and I ported it to FreeBSD 2.2.1 and everything was fine. I upgraded to 3.0 and now I experience problems apparently caused by using the notify_do_dispatch() call and ANY subsequent file I/O. I went ahead and attached the sample program that demonstrates this oddity, in case anyone wants to help me locate its source/cure. I compile it as follows: gcc -o main main.c -I/usr/X11R6/include -g -L/usr/X11R6/lib -lxview \ -lX11 -lolgx Any help would be appreciated! Ed --------------446B9B3D2781E494167EB0E7 Content-Type: text/plain; charset=us-ascii; name="main.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="main.c" #include #include #include #include #include #include #include #include #include #include #include #define TEXT_HEIGHT ( 200 ) #define TEXT_WIDTH ( 800 ) #define BUTTON_HEIGHT ( 40 ) #define MAX_SCRIPT_LEVELS ( 20 ) /******************************************************************************/ /*** Global XWindow Structures ***/ /******************************************************************************/ typedef struct { int frame_height; int frame_width; Frame frame; Display *display; Panel panel; Xv_window window; Tty tty; int tty_fd; } WinEnv; WinEnv BaseWin; main( int argc, char **argv ) { char msg[1024], prompt[1024], **cmd_word; int i, status; BaseWin.frame_height = 512; BaseWin.frame_width = 512; xv_init( XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0 ); BaseWin.frame = xv_create( (Xv_opaque) NULL, FRAME, FRAME_LABEL, "XImgEdit Version 1.1, January 1997", XV_SHOW, TRUE, FRAME_SHOW_LABEL, TRUE, FRAME_INHERIT_COLORS, TRUE, FRAME_SHOW_FOOTER, TRUE, FRAME_LEFT_FOOTER, "Copyright (c) 1997", WIN_ERROR_MSG, "Error creating base frame!", XV_WIDTH, TEXT_WIDTH, XV_HEIGHT, TEXT_HEIGHT + BUTTON_HEIGHT, 0 ); BaseWin.display = (Display *) xv_get( BaseWin.frame, XV_DISPLAY ); XFlush( BaseWin.display ); BaseWin.tty = xv_create( BaseWin.frame, TERMSW, WIN_INHERIT_COLORS, TRUE, TTY_ARGV, TTY_ARGV_DO_NOT_FORK, WIN_X, 0, WIN_Y, BUTTON_HEIGHT, NULL ); xv_set( BaseWin.tty, WIN_CONSUME_EVENTS, WIN_NO_EVENTS, LOC_WINENTER, LOC_WINEXIT, NULL, NULL ); window_fit_width( BaseWin.frame ); BaseWin.tty_fd = (int) xv_get( BaseWin.tty, TTY_TTY_FD ); dup2( BaseWin.tty_fd, fileno( stdout ) ); dup2( BaseWin.tty_fd, fileno( stdin ) ); BaseWin.panel = xv_create( BaseWin.frame, PANEL, XV_HEIGHT, BUTTON_HEIGHT, WIN_X, 0, WIN_Y, 0, 0 ); notify_do_dispatch(); printf( "\nYour Prompt Here!\n" ); /*** I default your prompt to ";", but you can change it ***/ strcpy( prompt, ";" ); while( 1 ) { char cmd_buffer[1024]; sprintf( msg, prompt ); write( fileno( stdout ), msg, strlen( msg ) ); fflush( stdout ); while( read( fileno(stdin), sizeof(cmd_buffer), cmd_buffer ) != 0 ); } free( cmd_word ); } --------------446B9B3D2781E494167EB0E7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message