From owner-freebsd-questions Fri Apr 19 09:36:49 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA16267 for questions-outgoing; Fri, 19 Apr 1996 09:36:49 -0700 (PDT) Received: from unix.stylo.it (unix.stylo.it [194.21.207.2]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA16252 for ; Fri, 19 Apr 1996 09:36:32 -0700 (PDT) Received: from styloserver.stylo.it (styloserver.stylo.it [194.21.207.253]) by unix.stylo.it (8.6.12/8.6.9) with SMTP id SAA03890 for ; Fri, 19 Apr 1996 18:38:03 +0200 Received: by styloserver.stylo.it with Microsoft Exchange (IMC 4.12.736) id <01BB2E1F.15D82010@styloserver.stylo.it>; Fri, 19 Apr 1996 18:36:12 +0200 Message-ID: From: Angelo Turetta To: "'freebsd-questions'" Subject: How can I use gethostname() in snake_saver ?? Date: Fri, 19 Apr 1996 18:36:07 +0200 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.12.736 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="---- =_NextPart_000_01BB2E1F.15DB2D50" Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. Contact your mail administrator for information about upgrading your reader to a version that supports MIME. ------ =_NextPart_000_01BB2E1F.15DB2D50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm learning unix programming, so I'm obviously missing some very basic information: please, be patient :-) I've modified snake_saver.c to make it use the host name as its 'snake' message. The hack is really simple: in saver_load() I use gethostname(3) to fill a static array that is later used by snake_saver() instead of the local array 'saves'. When I try to install the screen saver using modload(8), I get: /usr/src/lkm/syscons/snake> modload -u -o /tmp/saver_mod -e saver_init -q /lkm/snake_saver_mod.o /lkm/snake_saver_mod.o: Undefined symbol `_gethostname' referenced from text segment modload: /usr/bin/ld: return code 1 Is it only some -lxxxx missing or am I pretending too much :-) ???? Thanks for any help. Angelo. ----------------------------------------------------------------- Angelo Turetta mailto:aturetta@stylo.it Stylo Multimedia - Bologna - Italy http://www.stylo.it/ ------ =_NextPart_000_01BB2E1F.15DB2D50--