diff mbox

Use statfs64() in shm_open() and posix_getpt().

Message ID 20140516155303.GA22426@domone.podge
State New
Headers show

Commit Message

Ondřej Bílka May 16, 2014, 3:53 p.m. UTC
On 2014-04-13 08:44, Andreas Schwab wrote:
> Peter TB Brett <peter@peter-b.co.uk> 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'

Comments

Andreas Schwab May 19, 2014, 7:21 a.m. UTC | #1
Ondřej Bílka <neleai@seznam.cz> writes:

> On 2014-04-13 08:44, Andreas Schwab wrote:
>> Peter TB Brett <peter@peter-b.co.uk> 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':

Where does that fail?

Andreas.
diff mbox

Patch

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);