Subject: Re: OS dependencies

From: [email-masked] (Paul D. Smith)
Date: 04 Jan 1999 13:51:34 -0500

%% Dominik Vogt <[email-masked]> writes:

  dv> 1) events.c:

  dv>     #ifdef __hpux
  dv>       if (select(fd_width,(int *)&in_fdset, (int *)&out_fdset,0, NULL) > 0)
  dv>     #else
  dv>       if (select(fd_width,&in_fdset, &out_fdset, 0, NULL) > 0)
  dv>     #endif

This could probably be autoconf'd.  I don't have an HP system to test it
with, though.

  dv> 2) builtins.c:

  dv>     win = (unsigned long)strtol(num,NULL,0); /* SunOS doesn't have strtoul */

This can definitely be tested.  Typically you would include a GNU-ish
version of strtoul() and compile and include it on systems which don't
have it.

Is it really the case that this value can be that large (unsigned long)?
Maybe the thing to do is use strtol() as above, but then check for less
than 0 as an error condition?

  dv> 3) module.c:

  dv>     /* the write returns EWOULDBLOCK or EAGAIN if the pipe is full.
  dv>      * (This is non-blocking I/O). SunOS returns EWOULDBLOCK, OSF/1
  dv>      * returns EAGAIN under these conditions. Hopefully other OSes
  dv>      * return one of these values too. Solaris 2 doesn't seem to have
  dv>      * a man page for write(2) (!) */
  dv>     else if ((errno == EWOULDBLOCK)||(errno == EAGAIN)||(errno==EINTR))

I don't see any reasonable way of testing this one.

BTW, Solaris certainly does have a write(2) man page.  Note that on
Solaris some of the programmer-specific man pages, headers, and apps are
in packages which may not be installed on all systems... if you don't
have them you should get out your Solaris CD and install them.

The Solaris write(2) man page says it uses EAGAIN.  So does POSIX.  I
think the above test is OK, although we might want to clean up the
comment.

Note that EWOULDBLOCK might not be defined on all systems, so it should
be tested for existence and set to EAGAIN if it doesn't.

  dv> 4) bindings.c:

  dv>     /* in some BSD implementations, tolower(c) is not defined
  dv>      * unless isupper(c) is true */
  dv>     tmp1=string[i];
  dv>     if(isupper(tmp1))
  dv>       tmp1=tolower(tmp1);

ANSI C requires that tolower() return its argument unchanged if it is
not an uppercase letter (if isupper() isn't true).  One school of
thought here is to simply make the change without a test based on our
requirement of an ANSI C compiler/library.

Other than that I can't think of a comprehensive test: we can certainly
try it for some random non-alphabetic chars and see if it works, but I
suppose it could work for some and not others.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 4 Jan 1999 20:05:54 +0100

> than 0 as an error condition?

I don't know how likely it would be here, but wouldn't it be good
thing to have such a function stub just in case someone ever uses
strtoul?

Bye

Dominik

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]