lkml.org 
[lkml]   [1999]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Anyway to mknod from kernel?


On Tue, 26 Oct 1999, Adam D. Bradley wrote:

> That's how I've done it in the past. It's pretty easy, requires a
> dirt-simple setup script to be run one time (instead of after every
> install of the module, which I gather is what you want to avoid), and the
> code is dirt simple: (snipped from something I was working back in late
> 2.1 days)

... and will break apart RSN. _Please_ don't use the knowledge of
proc_dir_entry guts - there are cleaner ways to achieve the same result.

> struct proc_dir_entry *node = malloc(sizeof(struct proc_dir_entry));
> *node = (struct proc_dir_entry) {
> 0, strlen("device"), "device",
> S_IFBLK | S_IWUSR | S_IRUGO |
> MKDEV(device_major, device_minor),
> 1, 0, 0, 0,
> &blkdev_inode_operations,
> NULL, NULL, NULL, NULL, NULL,
> NULL, NULL, NULL, NULL, 0, 0 };
> proc_register(parent_proc_directory, node);

_That_ simply will not work. lower bits of i_mode are not a place for
i_rdev.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.046 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site