summaryrefslogtreecommitdiff
path: root/cpukit/libfs/src/devfs/devfs_mknod.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/devfs/devfs_mknod.c')
-rw-r--r--cpukit/libfs/src/devfs/devfs_mknod.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/cpukit/libfs/src/devfs/devfs_mknod.c b/cpukit/libfs/src/devfs/devfs_mknod.c
deleted file mode 100644
index 3b86d8c192..0000000000
--- a/cpukit/libfs/src/devfs/devfs_mknod.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file
- *
- * @brief Creates an item in the main device table.
- * @ingroup DevFsDeviceTable Define Device Table Type
- */
-
-/*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#if HAVE_CONFIG_H
- #include "config.h"
-#endif
-
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <rtems/devfs.h>
-
-int devFS_mknod(
- const rtems_filesystem_location_info_t *parentloc,
- const char *name,
- size_t namelen,
- mode_t mode,
- dev_t dev
-)
-{
- int rv = 0;
-
- if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') {
- if (S_ISBLK(mode) || S_ISCHR(mode)) {
- char *dupname = malloc(namelen);
-
- if (dupname != NULL) {
- devFS_node *node = parentloc->node_access;
-
- node->name = dupname;
- node->namelen = namelen;
- node->major = rtems_filesystem_dev_major_t(dev);
- node->minor = rtems_filesystem_dev_minor_t(dev);
- node->mode = mode;
- memcpy(dupname, name, namelen);
- } else {
- errno = ENOMEM;
- rv = -1;
- }
- } else {
- errno = ENOTSUP;
- rv = -1;
- }
- } else {
- if (!S_ISDIR(mode)) {
- errno = ENOTSUP;
- rv = -1;
- }
- }
-
- return rv;
-}