about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/getpt.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-17 20:37:54 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-17 20:37:54 +0000
commit9c9f3b1785aa47876b701cdf0e6711d6f1064b5e (patch)
treeb48ada70e709a4a2d757ef329e9d764eac55a299 /sysdeps/unix/sysv/linux/getpt.c
parenteccb7fb492273efc0a6a2059e23662ffdab9278b (diff)
downloadglibc-9c9f3b1785aa47876b701cdf0e6711d6f1064b5e.tar.gz
glibc-9c9f3b1785aa47876b701cdf0e6711d6f1064b5e.tar.xz
glibc-9c9f3b1785aa47876b701cdf0e6711d6f1064b5e.zip
Update.
1999-11-09  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/grantpt.c (grantpt): Add support for devfs.

	* sysdeps/unix/sysv/linux/getpt.c (__getpt): Check for devfs.
	Patch by German Jose Gomez Garcia <german@pinon.ccu.uniovi.es>.

	* sysdeps/unix/sysv/linux/linux_fsinfo.h (DEVFS_SUPER_MAGIC): Added.
Diffstat (limited to 'sysdeps/unix/sysv/linux/getpt.c')
-rw-r--r--sysdeps/unix/sysv/linux/getpt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index 511b9004c0..e6cfd18951 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -27,6 +27,9 @@
 /* Constant that identifies the `devpts' filesystem.  */
 #define DEVPTS_SUPER_MAGIC	0x1cd1
 
+/* Constant that identifies the `devfs' filesystem.  */
+#define DEVFS_SUPER_MAGIC	0x1373
+
 /* Path to the master pseudo terminal cloning device.  */
 #define _PATH_DEVPTMX _PATH_DEV "ptmx"
 /* Directory containing the UNIX98 pseudo terminals.  */
@@ -50,10 +53,13 @@ __getpt (void)
 	  struct statfs fsbuf;
 	  static int devpts_mounted;
 
-	  /* Check that the /dev/pts filesystem is 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
-		  && fsbuf.f_type == DEVPTS_SUPER_MAGIC))
+		  && fsbuf.f_type == DEVPTS_SUPER_MAGIC)
+	      || (__statfs (_PATH_DEV, &fsbuf) == 0	
+		  && fsbuf.f_type == DEVFS_SUPER_MAGIC))
 	    {
 	      /* Everything is ok.  */
 	      devpts_mounted = 1;