3 * A mkdir module for LAB - Linux As Bootldr.
6 #include <linux/kernel.h>
7 #include <linux/module.h>
8 #include <linux/init.h>
9 #include <linux/syscalls.h>
10 #include <linux/lab/lab.h>
11 #include <linux/lab/commands.h>
13 void lab_cmd_mkdir(int argc
,const char** argv
);
15 int labmkdir_init(void)
17 lab_addcommand("mkdir", lab_cmd_mkdir
, "Create a directory");
22 void labmkdir_cleanup(void)
24 lab_delcommand("mkdir");
27 void lab_cmd_mkdir(int argc
,const char** argv
)
32 lab_puts("mkdir: syntax: mkdir dirname\r\n");
36 err
= sys_mkdir(argv
[1], 0000);
38 lab_printf("mkdir: failed to create %s (errno %d)\n", argv
[1], err
);
41 MODULE_AUTHOR("Joshua Wise");
42 MODULE_DESCRIPTION("LAB mkdir Module");
43 MODULE_LICENSE("GPL");
44 module_init(labmkdir_init
);
45 module_exit(labmkdir_cleanup
);