From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by sourceware.org (Postfix) with ESMTPS id 73EE23857C68 for ; Wed, 3 Mar 2021 06:14:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 73EE23857C68 Received: by mail-io1-xd35.google.com with SMTP id f20so24487207ioo.10 for ; Tue, 02 Mar 2021 22:14:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W3L4xtW+1yt7CS9vFR98BHq++89nuaBuEjC8hIsXGg0=; b=fbqekGRJOgGUoBVXQ5Ijfv00Pw9/FNa+vA8YvEsA8c9FbO/Mou8AQ5IVcBIswMFp2m xU/f3Huxf1iORc5Kf9TjiDN7ZSrkGy6ivHruJ9W37V18VI5gNVJFWdQ/fME4if9XoL8G QfaWZAVoqA0EDyyeIxVp6cx0R8xk73sboda9qVKEB+g9ZqiUnbtGkjxZQtGicyaDWbbD 9rQDP2sM9ACsVFsqnjJBZi1yqdZlKFh2Axv7pkfnJLlNbf+ayHixJfLF+pqCw0ywOJbJ pifOlZgueRQRaTevVkMouv4beNNuy0hymtaJUmyPsZBjFeUSU9h9bNtfowzto4nll40G D6BQ== X-Gm-Message-State: AOAM532eNljDILKJ675RU+FNYoY3Y7sy5CvZlOtaesT4B+FIkQRVHeAq TDHgn3XBtyEUPDZ/ErLot2kR60+LFJ6sloRo+sA= X-Google-Smtp-Source: ABdhPJzlTYuCvAHDtR8VECgMf+IpW9s+oiI8uBeZIe01KlQ0jQzfUmJmPNxK0BcSLTYG+80/aTOY6pJRmCysYjJ6s/4= X-Received: by 2002:a02:449:: with SMTP id 70mr24717572jab.137.1614752061973; Tue, 02 Mar 2021 22:14:21 -0800 (PST) MIME-Version: 1.0 References: <87h7ltw8f4.fsf@oldenburg.str.redhat.com> In-Reply-To: <87h7ltw8f4.fsf@oldenburg.str.redhat.com> From: Peng Yu Date: Wed, 3 Mar 2021 00:14:10 -0600 Message-ID: Subject: Re: Where is setsockopt() defined? To: Florian Weimer Cc: Peng Yu via Libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 06:14:23 -0000 > It's in sysdeps/unix/sysv/linux/setsockopt.c. https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d8c7d79c4c95c72c1b/sysdeps/unix/sysv/linux/setsockopt.c There is not much code in this file. Based on the manpage of setsockopt() (which refers to socket(7)), setsockopt() should be able to process many different cases. So I'd expect many branch statements. Where are they defined? Things like INLINE_SYSCALL and SOCKETCALL are too complicated to comprehend. How to understand what they do? https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d8c7d79c4c95c72c1b/sysdeps/unix/sysv/linux/sysdep.h#L42 https://github.com/bminor/glibc/blob/83908b3a1ea51e3aa7ff422275940e56dbba989f/sysdeps/unix/sysv/linux/socketcall.h#L85 -- Regards, Peng