delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/07/23:41:34

From: dslate AT interaccess DOT com ("David J. Slate")
Subject: Problems with gnu-win32
7 Sep 1997 23:41:34 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199709071354.IAA30386.cygnus.gnu-win32@pc4.prs.nunet.net>
Original-To: dslate AT interaccess DOT com, gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

To: gnu-win32 AT cygnus DOT com
Reply-To: dslate AT interaccess DOT com
Subject: Problems with gnu-win32

I recently installed the gnu-win32 package (b18, with development tools) on
a DELL PentiumII box running Windows-95, and on a DELL Pentium-Pro box
running Windows-NT.  I'm trying to port a complex application from a
Linux/Unix environment to both of these systems.  Much of this application
is now running ok, including some hairy I/O involving inter-process pipes
and select calls.  Here are some of the things that don't seem to be
working properly:

1. The hostname command seems to work on Win95 but aborts on WinNT.
2. popen seems to work on WinNT, but on Win95 only read calls (mode "r")
   work, while write calls ("w") fail.
3. Attempts to retrieve cpu time using getrusage() fail on both systems,
   returning junk.  Here is the code, which works ok on Linux/Unix:

--------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

/*
 * double CpuTime( ) - report Dsu cpu time.
 */
double
CpuTime( void)
{
	double	  t;
	struct rusage   r;

	getrusage( RUSAGE_SELF, &r);
	t = r.ru_utime.tv_sec + r.ru_stime.tv_sec +
	        (r.ru_utime.tv_usec + r.ru_stime.tv_usec) / 1000000.0;
	return (t);
--------------------------------------------------------------------------

Any ideas on these problems?

Thanks for the gnu-win32 package, and for whatever help you can provide,

-- Dave Slate
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019