GRASS 4.2 uses gets() function, which is unsafe, many times and
libc.so warns this every gets() call. There are so many garbage output.

You should rebuild standard c library.

Get library sources from FreeBSD archives,

then

        cd /usr/src/lib/libc

        vi stdio/gets.c
                COMMENT OUT THE FOLLOWING LINES:

                        if (!warned) {
                                (void) write(STDERR_FILENO, w, sizeof(w) - 1);
                                warned = 1;
                        }

                LIKE THIS:

                /*
                        if (!warned) {
                                (void) write(STDERR_FILENO, w, sizeof(w) - 1);
                                warned = 1;
                        }
                */

                SAVE FILE AND QUIT VI

        make

        vi stdio/gets.c
                UNCOMMENT THE ABOVE LINES LIKE THIS:

                        if (!warned) {
                                (void) write(STDERR_FILENO, w, sizeof(w) - 1);
                                warned = 1;
                        }

                SAVE FILE AND QUIT VI


        mkdir /usr/local/grass42/lib

        cd /usr/local/grass42/lib

        cp /usr/obj/usr/src/lib/libc/libc.so.3 .

		IF /usr/obj/.../libc.so.3 DOES NOT EXIST,
        		cp /usr/src/lib/libc/libc.so.3 .

        ln -s libc.so.3 libc.so



Now prepend the following line to /usr/local/grass42/bin/grass4.2:

        export LD_LIBRARY_PATH=/usr/local/grass42/lib:$LD_LIBRARY_PATH

Here is my grass4.2:
----<cut here>----
:
export LD_LIBRARY_PATH=/usr/local/grass42/lib:$LD_LIBRARY_PATH
GISBASE=/usr/local/grass42
export GISBASE
exec $GISBASE/etc/GIS.sh
----<cut here>----



If you need FreeBSD 3.3 libc library, this is available from:

        ftp://geni.knu.ac.kr/pub/geni/patch/grass42/libc.so.3

Do not forget 'ln -s libc.so.3 libc.so' and LD_LIBRARY_PATH.


Regards,
Huidae Cho


