Re: Device driver query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> > You said that you want to create a file at loading
> > time and want to
> > remove that file forom file system at unloading
> > time

Why not use the /proc filesystem for this? It is quite simple.

Example:

int scull_read_procmem (char *buf, char **start, off_t offset, int
count, int *eof, void *data) {
	int len = 0;
	len += sprintf (buf+len, "\nFrom scull_read_procmem");
	return len;		
}

static void scull_create_proc() {
	create_proc_read_entry ("scullmem",
				 0,
				 NULL,	
				 scull_read_procmem,
			 	 NULL);
}

Regards,

Shaks

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux