Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Mar 2006 20:31:55 +0530
From:      "Anupam Deshpande" <anupamdeshpande@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Using open system call in KLD
Message-ID:  <25da4ac50603050701j3fc63843oe288f6d34b67d115@mail.gmail.com>

index | next in thread | raw e-mail

Hello,
         I have used open system call in KLD to create a file. But after
inserting the module the file is not created though the file descriptor
returned is non zero. I also used close system call to close the file, using
the descriptor returned by open system call.
         I called the following function from my module:

int f_open(void)
{
   struct open_args o;
   struct close_args c;
   struct thread *td = curthread;
   int fd;
   o.path = "/home/file1.c";
   o.flags = O_CREAT | O_RDWR | O_APPEND;
   o.mode = 777;
   fd = open(td,&a);
   printf("\nFile descriptor  = %d",fd);
   c.fd = fd;
   close(td,&c);
}


         Can anyone help me in this regard?

TIA,
Anupam Deshpande


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25da4ac50603050701j3fc63843oe288f6d34b67d115>