>>>>> "Arnon" == Arnon Kanfi <arnon_at_gilly.datatools.com> writes:
Arnon; There is an unresolved reference to strerror() in builtins.c on SunOs (I am
Arnon; using SunOs 4.1.4 but I believe that this problem will occur on other
Arnon; versions as well). My fix was to add the following lines to the top of the
Arnon; file:
Arnon; #if defined __sun__ && !defined SYSV
Arnon; extern char *sys_errlist[] ;
Arnon; #define strerror(err)   sys_errlist[err]
Arnon; #endif
Arnon; This is not ideal because garbage error code may cause core dumps. A function
Arnon; which does boundary checking would be better, however it should be OK for most
Arnon; cases.
Another potenial problem with this workaround is that the
sys_errlist array may be smaller than 'err' elements.
To quote from the SunOS man page of perror() function:
...
     int sys_nerr;
     char *sys_errlist[];
     int errno;
...
"To simplify variant formatting of messages,  the  vector  of
     message  strings  sys_errlist is provided; errno can be used
     as an index in this table to get the message string  without
     the  newline.   sys_nerr  is the number of messages provided
     for in the table; it should be  checked  because  new  error
     codes  may  be  added to the system before they are added to
     the table."
So the correct fix (IMHO) would be:
#if defined __sun__ && !defined SYSV
extern char *sys_errlist[] ;
extern int  sys_nerr;
#define strerror(err)  \
   (err < sys_nerr) ? sys_errlist[err] : sprintf ("Unknown errno %d", err)
#endif
An alternative (that I use) is: if you have Sun's SPARCompiler, you
can still compile with gcc, just add the libansi.a library to the link:
It's in <path>/SC3.0.1/lib/libansi.a
/* Amir J. Katz  E-mail: amir_at_ddddf.com   WWW: 
http://www.ddddf.com */
/* New Dimension Software, LTD., Tel-Aviv, Israel                   */
/* .. I busted a mirror and got seven years bad luck, but         ..*/
/* .. my lawyer thinks he can get me five.        (Steven Wright) ..*/
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Apr 30 1996 - 02:58:44 BST