[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

please add support for long long dev_t



reassign 289945 libc6
retitle 289945 please add support for long long dev_t
tag 289945 patch upstream
thanks

Please apply to allow udev to create nodes for drivers which need more
than 2^8 minors.

On Jan 12, Roland Dreier <roland@topspin.com> wrote:

> (I guess this bug should be reassigned to libc6)
> 
> It seems that the change to glibc's mknod was applied about 15 months
> ago, between glibc 2.3.2 and glibc 2.3.3.  Here's the patch taken from
> glibc CVS:
> 
> Index: glibc-2.3.2/sysdeps/unix/sysv/linux/xmknod.c
> ===================================================================
> --- glibc-2.3.2.orig/sysdeps/unix/sysv/linux/xmknod.c	2002-08-04 01:22:58.000000000 -0700
> +++ glibc-2.3.2/sysdeps/unix/sysv/linux/xmknod.c	2005-01-11 17:43:15.209774232 -0800
> @@ -35,7 +35,7 @@
>  int
>  __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
>  {
> -  unsigned short int k_dev;
> +  unsigned long long int k_dev;
>  
>    if (vers != _MKNOD_VER)
>      {
> @@ -44,9 +44,12 @@
>      }
>  
>    /* We must convert the value to dev_t type used by the kernel.  */
> -  k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff);
> +  k_dev =  (*dev) & ((1ULL << 32) - 1);
> +  if (k_dev != *dev)
> +    return EOVERFLOW;
>  
> -  return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev);
> +  return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode,
> +			 (unsigned int) k_dev);
>  }
>  
>  weak_alias (__xmknod, _xmknod)

-- 
ciao,
Marco

Attachment: signature.asc
Description: Digital signature


Reply to: