Back to index

glibc  2.9
Functions
makedev.c File Reference
#include <endian.h>
#include <sys/sysmacros.h>

Go to the source code of this file.

Functions

unsigned int gnu_dev_major (unsigned long long int dev)
unsigned int gnu_dev_minor (unsigned long long int dev)
unsigned long long int gnu_dev_makedev (unsigned int major, unsigned int minor)

Function Documentation

unsigned int gnu_dev_major ( unsigned long long int  dev)

Definition at line 24 of file makedev.c.

{
  return ((dev >> 8) & 0xfff) | ((unsigned int) (dev >> 32) & ~0xfff);
}
unsigned long long int gnu_dev_makedev ( unsigned int  major,
unsigned int  minor 
)

Definition at line 36 of file makedev.c.

{
  return ((minor & 0xff) | ((major & 0xfff) << 8)
         | (((unsigned long long int) (minor & ~0xff)) << 12)
         | (((unsigned long long int) (major & ~0xfff)) << 32));
}
unsigned int gnu_dev_minor ( unsigned long long int  dev)

Definition at line 30 of file makedev.c.

{
  return (dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff);
}