Back to index

glibc  2.9
Functions
xmknod.c File Reference
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <bp-checks.h>

Go to the source code of this file.

Functions

int __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)

Function Documentation

int __xmknod ( int  vers,
const char *  path,
mode_t  mode,
dev_t dev 
)

Definition at line 34 of file xmknod.c.

{
  unsigned long long int k_dev;

  if (vers != _MKNOD_VER)
    {
      __set_errno (EINVAL);
      return -1;
    }

  /* We must convert the value to dev_t type used by the kernel.  */
  k_dev =  (*dev) & ((1ULL << 32) - 1);
  if (k_dev != *dev)
    {
      __set_errno (EINVAL);
      return -1;
    }

  return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode,
                      (unsigned int) k_dev);
}