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>

next in thread | raw e-mail | index | archive | help
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, usin=
g
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 =3D curthread;
   int fd;
   o.path =3D "/home/file1.c";
   o.flags =3D O_CREAT | O_RDWR | O_APPEND;
   o.mode =3D 777;
   fd =3D open(td,&a);
   printf("\nFile descriptor  =3D %d",fd);
   c.fd =3D fd;
   close(td,&c);
}


         Can anyone help me in this regard?

TIA,
Anupam Deshpande



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