From owner-freebsd-net@freebsd.org Thu Jan 7 11:07:58 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13346A6636E for ; Thu, 7 Jan 2016 11:07:58 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9610615B2 for ; Thu, 7 Jan 2016 11:07:57 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id z124so324929073lfa.3 for ; Thu, 07 Jan 2016 03:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=KqAEe/VWYm5x8qkoWSTZuw41Di3pZlwSW9lotIL/YgA=; b=ZxVc8lOlgOFU+GO9ccGshhiW+7emvNoemz8co34BjdBPgcd+ehTUvU6xV1LMWXevCj Mg4lL80e6Vuufwjld/SvMQPxN/CvzMtHCfpONN0Zv/+8QgUVvbavbtUMLtxrN+ItSXMt l03irF//A+lups2qZvqQcZtRMPuu/0mKj9zZsRMI4QClpZC8BQTC1cDHdLJVQ9D/JV4z BnbWsUHTVZ6/+zjbkQo94eJzhDfubC0gpREL98W2qH9VLSpsEDNRChDlsZYjSelf9Hvi gnHXJ4cqEfYo9l6iHYyt+U1RtaEADaqKazXwPExwa81XAI6F7l9BBYvVKeoMVyQ6AZJL sDUA== MIME-Version: 1.0 X-Received: by 10.25.25.142 with SMTP id 136mr32035045lfz.42.1452164875697; Thu, 07 Jan 2016 03:07:55 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.13.33 with HTTP; Thu, 7 Jan 2016 03:07:55 -0800 (PST) Date: Thu, 7 Jan 2016 03:07:55 -0800 X-Google-Sender-Auth: sTSYjmAn2-aj8eSBwvUkJsL47AE Message-ID: Subject: generated files (Re: Does FreeBSD have sendmmsg or recvmmsg system calls?) From: Luigi Rizzo To: Konstantin Belousov Cc: Boris Astardzhiev , Mark Delany , "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 11:07:58 -0000 I wonder how complex it would be to autogenerate at least part of the various components required when adding a syscall like this. It looks like the number of places to touch (see chunks below) and the ordering constraints make the manual process very prone to errors. This said, it might be nice to add some explanation in the various places, e.g. Symbol.map could do with a comment describing the meaning of the various groups FBSD_1.0 FBSD_1.1 FBSDprivate_1.0 and so on. cheers luigi On Thu, Jan 7, 2016 at 2:54 AM, Konstantin Belousov wrote: > On Thu, Jan 07, 2016 at 12:28:32PM +0200, Boris Astardzhiev wrote: > See inline comments and final notes at the end. > >> diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h >> index 5caf9a3..7e2a902 100644 >> --- a/lib/libc/include/libc_private.h >> +++ b/lib/libc/include/libc_private.h >> @@ -200,8 +200,10 @@ enum { >> INTERPOS_pselect, >> INTERPOS_recvfrom, >> INTERPOS_recvmsg, >> + INTERPOS_recvmmsg, >> INTERPOS_select, >> INTERPOS_sendmsg, >> + INTERPOS_sendmmsg, >> INTERPOS_sendto, >> INTERPOS_setcontext, >> INTERPOS_sigaction, > The interposing table must be extended at the end, and not in the middle. > otherwise you introduce too large inconsistence with older libthr. > > That said, you changed libc table, but did not updated libthr. The result > is random segfaults in the multithreaded processes. > >> diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map >> index 7b3257c..6cc3c6e 100644 >> --- a/lib/libc/sys/Symbol.map >> +++ b/lib/libc/sys/Symbol.map >> @@ -220,6 +220,7 @@ FBSD_1.0 { >> reboot; >> recvfrom; >> recvmsg; >> + recvmmsg; >> rename; >> revoke; >> rfork; >> @@ -240,6 +241,7 @@ FBSD_1.0 { >> semsys; >> sendfile; >> sendmsg; >> + sendmmsg; >> sendto; >> setaudit; >> setaudit_addr; > The versioning is wrong, new non-private symbols for 11.0 go into _1.4. >