OS X - Development and Darwin Discussion and questions about development for Mac OS X.

write to file from kext


Post Reply New Thread Subscribe

 
Thread Tools
dr_springfield
Guest
 
Posts: n/a

Trying to get my kext to write to a file... does anyone know how to do this? I've discovered I can only use the headers in the Kernel framework, and sys/fcntl.h should be able to open up a file at least, but I can't seem to get it to be recognized by the compiler (I include it and I get an error that open is undeclared, as well as write and close).

This should be entirely possible (but I don't know). I know I can write to the syslog with printf, but this isn't the desired behavior. Thanks for any help.

dr_springfield


Edit: well, problem not really solved. If anyone know what's wrong with this, please let me know, because it causes kernel panics and I can't figure it out:

char pathBuf[]="/my_dir";
struct nameidata *ndp=(struct nameidata*)_MALLOC(sizeof(struct nameidata),M_FREE,M_WAITOK); NDINIT(ndp,CREATE,LOCKLEAF,UIO_USERSPACE,pathBuf,c urrent_proc());error = namei(ndp);
printf("namei returns %u\n",error);

Last edited by dr_springfield; 09-05-2004 at 08:24 AM.
QUOTE Thanks

Post Reply New Thread Subscribe


« compression to mp4 codec? | "shutdown -fh now" vs. the power button »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
111 Gigabyte temp file. WHooooo-aaat fleiva83 OS X - Operating System 3 08-11-2004 03:29 PM
HELP! Catalog B-tree error, can't delete a HUGE preference file markpetrowsky Running Windows (or anything else) on your Mac 5 03-12-2004 11:39 AM
make and CDRecord plunger OS X - Development and Darwin 3 12-29-2003 05:49 PM

All times are GMT -4. The time now is 12:20 AM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?