Writing to a file from kernel

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

 



Hi,

  I am having a weird problem writing to a file from the kernel.  At the 
statement ' file->f_op->write(...)' the module just seems to hang.  Could 
anyone tell me why this might be the case?  The code is pasted below.

Thanks,
-Amit

-----------------------------------------------------------------------------------

int init_module()
{
        struct file *file = NULL;
        struct inode *inode;
        mm_segment_t fs;
        char *str = "foo";


        file = filp_open("/tmp/test.log", O_WRONLY|O_APPEND,0);

        if (IS_ERR(file)||(file==NULL)) {


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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