All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srinivas Surabhi" <srinivas.surabhi@wipro.com>
To: linux-kernel@vger.kernel.org
Date: Tue, 20 Feb 2001 16:26:29 +0530	[thread overview]
Message-ID: <77452C3A15FD.AAA5AD7@vindhya.mail.wipro.com> (raw)

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.




                 reply	other threads:[~2001-02-20 11:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77452C3A15FD.AAA5AD7@vindhya.mail.wipro.com \
    --to=srinivas.surabhi@wipro.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.