From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 9BCEE3844040 for ; Mon, 12 Apr 2021 16:13:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9BCEE3844040 Received: by mail-il1-x132.google.com with SMTP id c15so11510934ilj.1 for ; Mon, 12 Apr 2021 09:13:02 -0700 (PDT) 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=7rHAtyvHdeEtlXVIR0MfSopu4W/DO6kZO6o7BJB3s4M=; b=mClXfHOMGfkeC9T7vcQqRrO7cKZjMVN1NaiIdiEnLfr9wL4susi7QacGtZh7Z39Bxj gIN/rfw5WUPMjuqv+dYMFSq19ScLbZlEjrcOpq9ibVD9DGBwcY3/dvEuSh8I8J3AVsrp UrumyhIfg+QzirA/eKQy6uhd7gsC0rC4rECUE6O0HFPR8csOs3OplSwVjpt/BCcLQRso mbKPgMNO2mFCGtiay8Ts+qlx0FDKD/ODvmtNMnc7Zhyp5pP1vqcf9gU5vE1UM6NpODA0 bIM9YV5pFmwbnEAtNUcd9RmtKF0UxAJnLU49dKLW/kfzt0gCI3GPopUW7bl9y9opf5M7 NQEw== X-Gm-Message-State: AOAM530Lg86BfNbfFKBBb8tij+fvU8rIesFQU1MEML5spFd/e8PSNyno bSk3OSzg0KD+Lq1EZ1rUKKm5OhadZVN9yl/xPZI= X-Google-Smtp-Source: ABdhPJyP+JkAsqY5T307NMFDHcuKe0SezkykiFYHPcTg8gqHWyBIrd5qsBHl7UALKyAM//+iJQBcg5GNR2Eql6YoTmU= X-Received: by 2002:a05:6e02:1c49:: with SMTP id d9mr2878910ilg.95.1618243982216; Mon, 12 Apr 2021 09:13:02 -0700 (PDT) MIME-Version: 1.0 References: <87wnt7iizx.fsf@oldenburg.str.redhat.com> In-Reply-To: <87wnt7iizx.fsf@oldenburg.str.redhat.com> From: Peng Yu Date: Mon, 12 Apr 2021 11:12:50 -0500 Message-ID: Subject: Re: What is the point of IPC_PRIVATE of shmget? 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: Mon, 12 Apr 2021 16:13:03 -0000 On Mon, Apr 12, 2021 at 11:07 AM Florian Weimer wrote: > > * Peng Yu via Libc-help: > > > I don't get the point of IPC_PRIVATE of shmget(). Since it is just > > used by the current process, why not just use malloc? > > > > Can anybody give a real example in which IPC_PRIVATE must be used, but > > malloc or other variant of *alloc functions are not appropriate to > > use? Thanks. > > shmget(2) says this: > > | BUGS > | The name choice IPC_PRIVATE was perhaps unfortunate, IPC_NEW > | would more clearly show its function. > > Does this answer your question? No. That is just a naming issue. It is still privately used by the current process instead of other processes. -- Regards, Peng