From owner-freebsd-hackers Sat Nov 25 20:52:46 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp2.mail.yahoo.com (smtp2.mail.yahoo.com [128.11.68.32]) by hub.freebsd.org (Postfix) with SMTP id 6E18337B4F9 for ; Sat, 25 Nov 2000 20:52:36 -0800 (PST) Received: from host-216-226-229-81.interpacket.net (HELO yahoo.com) (216.226.229.81) by smtp.mail.vip.suc.yahoo.com with SMTP; 26 Nov 2000 04:52:29 -0000 X-Apparently-From: Message-ID: <3A208949.8F7AA342@yahoo.com> Date: Sat, 25 Nov 2000 22:53:45 -0500 From: "Yonny Cardenas B." Organization: Universidad de los Andes X-Mailer: Mozilla 4.72 [en] (X11; I; FreeBSD 4.0-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: hackers@freebsd.org Subject: Link error in the system call Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello I have the following link error adding new system calls to FreeBSD kernel when it uses send() or recv() with sockets. > linking kernel > rtp_unix.o: In function `_sys_send': > rtp_unix.o(.text+0x1c8): undefined reference to `send' Perhaps the problem is the system call's type in syscalls.master file (show it below), because the rtp_unix.c has calls to socket(), connect() and bind() and it doesn't have the same problem. Is the type COMPAT for compatibility with BSD4.3 system calls (COMPAT_43)? Why? You can look below in the files generated from syscalls.master file: init_sysent.c has the "compat" conditional statement for send() and recv(). And syscalls.c has entries "old.send" and "old.recv", for the other sockets system calls are different. What should I do to solve this link error ? Can I change COMPAT type for STD type in syscalls.master without problems? Thanks for your help. /* ---------------- syscalls.master ------------ */ ; Processed to created init_sysent.c, syscalls.c and syscall.h. ; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments ; types: ; STD always included ; COMPAT included on COMPAT #ifdef 97 STD BSD { int socket(int domain, int type, int protocol); } 98 STD BSD { int connect(int s, caddr_t name, int namelen); } 99 CPT_NOA BSD { int accept(int s, caddr_t name, int *anamelen); } \ accept accept_args int 101 COMPAT BSD { int send(int s, caddr_t buf, int len, int flags); } 102 COMPAT BSD { int recv(int s, caddr_t buf, int len, int flags); } 104 STD BSD { int bind(int s, caddr_t name, int namelen); } /* ----------------- init_sysent.c ------------------ */ #ifdef COMPAT_43 #define compat(n, name) n, (sy_call_t *)__CONCAT(o,name) #else #define compat(n, name) 0, (sy_call_t *)nosys #endif { 3, (sy_call_t *)socket }, /* 97 = socket */ { 3, (sy_call_t *)connect }, /* 98 = connect */ { compat(3,accept) }, /* 99 = old accept */ { compat(4,send) }, /* 101 = old send */ { compat(4,recv) }, /* 102 = old recv */ { 3, (sy_call_t *)bind }, /* 104 = bind */ /* ---------------- syscalls.c ---------------- */ "socket", /* 97 = socket */ "connect", /* 98 = connect */ "old.accept", /* 99 = old accept */ "old.send", /* 101 = old send */ "old.recv", /* 102 = old recv */ "bind", /* 104 = bind */ +------------------------------------------------------------------+ | YONNY CARDENAS B. Apartado Aereo 22828 | | Systems Engineer Santafe de Bogota D.C. | | Colombia - South America | | Student M.Sc. Tel: +571 6095477 | | UNIVERSIDAD DE LOS ANDES mailto: y-carden@uniandes.edu.co | | ycardena@computer.org | | ICQ #: 46933750 | +------------------------------------------------------------------+ UNIX is BSD, and FreeBSD is an advanced 4.4BSD __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message