* (no subject)
@ 2001-02-20 10:56 Srinivas Surabhi
0 siblings, 0 replies; only message in thread
From: Srinivas Surabhi @ 2001-02-20 10:56 UTC (permalink / raw)
To: linux-kernel
In application program ,code for call to write system call is given
below...
#include<fcntl.h>
main()
{
char* buff="hello";
int count,fd;
fd=open("/dev/pseudo",O_RDWR);
write(fd,buff,5);
}
In driver module code for getting the buffer and count
#include<all related header files...>
int psuedo_write(struct inode*in,struct file*fp,char *buf,int count)
{
kprintf("<1>pseudo_write routine called \n");
kprintf("<1>count=%d \n",count);
kprintf("<1>buffer=%s \n",buff);
return 0;
}
/******so here after inserting the module into the kernel using insmod
pseudo.o and executing the application cc -c pseudo_app.c, the o/p on
console is *****/
"pseudo_write routine called"
"count=9988345352" /*garbage*/
"buffer=@#%h" . /*garbage*/
/*** but neither the buffer is carried from user space to kernel space nor
the count, why?***/Please help me out.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-02-20 11:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-20 10:56 Srinivas Surabhi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox