Using open system call in KLD
- From: "Anupam Deshpande" <anupamdeshpande@xxxxxxxxx>
- Date: Sun, 5 Mar 2006 20:31:55 +0530
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
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Using open system call in KLD
- From: Robert Watson
- Re: Using open system call in KLD
- Prev by Date: Re: wireless on a laptop
- Next by Date: Re: Using open system call in KLD
- Previous by thread: Re: wireless on a laptop
- Next by thread: Re: Using open system call in KLD
- Index(es):
Relevant Pages
|