From patchwork Fri May 16 15:53:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Bilka X-Patchwork-Id: 971 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 46E4436007A for ; Fri, 16 May 2014 08:53:13 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id CCA3B59DCAB9; Fri, 16 May 2014 08:53:12 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 7667959D7186 for ; Fri, 16 May 2014 08:53:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=y2he ZCr9i51bIYJ6deUuOdAn/QzCWPgZBR/8P0tYXFuvJLJuGUObmH773Vd89VtXPar6 uE2xjpyHVd+NuLV07Yw/tkmwMDYTTPZ7P3QceIWFL6H/2vrHq1jtwWaS57BlsruV VNL4RprrOqAIKbYVbve5J0DfPMW0pdVDECONz5w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=EkGUbH0Rgg 4euBIJrrQ+revqnUM=; b=JkdzEJ7+N58t71IeE5ncxMm/LGIUaJL+J1dDguJUAT pPytQZGnpSL09CXqVSY2L0ycdYg069uPJlFmG1OwB8ww5A7Lm265VglmRbEgyWx+ PhDQGhHvldMv4GMuJZgwAxSQv/bPiddAaaIaAfNW9LiiHTqgsV6k3lWw1zdsCO6M s= Received: (qmail 7273 invoked by alias); 16 May 2014 15:53:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 7256 invoked by uid 89); 16 May 2014 15:53:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Fri, 16 May 2014 17:53:03 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: Andreas Schwab Cc: Peter TB Brett , libc-alpha@sourceware.org Subject: Re: [PATCH] Use statfs64() in shm_open() and posix_getpt(). Message-ID: <20140516155303.GA22426@domone.podge> References: <1397373978-17449-1-git-send-email-peter@peter-b.co.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1397373978-17449-1-git-send-email-peter@peter-b.co.uk> User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in On 2014-04-13 08:44, Andreas Schwab wrote: > Peter TB Brett writes: > >> + || (statfs64 (_PATH_DEVPTS, &fsbuf) == 0 > > This is not namespace clean, and will introduce a PLT call (you did run > make check?). To move patch forward what do you suggest? If I substituted statfs64 to __statfs64 it gives following failure /home/wizard/glibcdev/test3/libc_pic.os: In function `__posix_openpt': /home/wizard/glibcdev/glibc/login/../sysdeps/unix/sysv/linux/getpt.c:55: undefined reference to `__statfs64' /home/wizard/glibcdev/glibc/login/../sysdeps/unix/sysv/linux/getpt.c:57: undefined reference to `__statfs64' diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c index cea2fa6..8ce628a 100644 --- a/sysdeps/unix/sysv/linux/getpt.c +++ b/sysdeps/unix/sysv/linux/getpt.c @@ -46,15 +46,15 @@ __posix_openpt (oflag) fd = __open (_PATH_DEVPTMX, oflag); if (fd != -1) { - struct statfs fsbuf; + struct statfs64 fsbuf; static int devpts_mounted; /* Check that the /dev/pts filesystem is mounted or if /dev is a devfs filesystem (this implies /dev/pts). */ if (devpts_mounted - || (__statfs (_PATH_DEVPTS, &fsbuf) == 0 + || (__statfs64 (_PATH_DEVPTS, &fsbuf) == 0 && fsbuf.f_type == DEVPTS_SUPER_MAGIC) - || (__statfs (_PATH_DEV, &fsbuf) == 0 + || (__statfs64 (_PATH_DEV, &fsbuf) == 0 && fsbuf.f_type == DEVFS_SUPER_MAGIC)) { /* Everything is ok. */ diff --git a/sysdeps/unix/sysv/linux/shm_open.c b/sysdeps/unix/sysv/linux/shm_open.c index cec6fdb..52847d5 100644 --- a/sysdeps/unix/sysv/linux/shm_open.c +++ b/sysdeps/unix/sysv/linux/shm_open.c @@ -55,15 +55,15 @@ static void where_is_shmfs (void) { char buf[512]; - struct statfs f; + struct statfs64 f; struct mntent resmem; struct mntent *mp; FILE *fp; /* The canonical place is /dev/shm. This is at least what the documentation tells everybody to do. */ - if (__statfs (defaultdir, &f) == 0 && (f.f_type == SHMFS_SUPER_MAGIC - || f.f_type == RAMFS_MAGIC)) + if (__statfs64 (defaultdir, &f) == 0 && (f.f_type == SHMFS_SUPER_MAGIC + || f.f_type == RAMFS_MAGIC)) { /* It is in the normal place. */ mountpoint.dir = (char *) defaultdir; @@ -97,8 +97,8 @@ where_is_shmfs (void) /* First make sure this really is the correct entry. At least some versions of the kernel give wrong information because of the implicit mount of the shmfs for SysV IPC. */ - if (__statfs (mp->mnt_dir, &f) != 0 || (f.f_type != SHMFS_SUPER_MAGIC - && f.f_type != RAMFS_MAGIC)) + if (__statfs64 (mp->mnt_dir, &f) != 0 || (f.f_type != SHMFS_SUPER_MAGIC + && f.f_type != RAMFS_MAGIC)) continue; namelen = strlen (mp->mnt_dir);