On Nov 9, 2003, at 12:22, Hao Li wrote: Hi all! I've a little app with its own kernel extension that logs some data back to the app in the user space. The app creates a temp file, and the kext open it and write data back. I'm not sure if it's the best way to do that, but it works well in Jaguar. Your instincts are correct. It's not the best way to do this, and you've found one of them. Using in-the-kernel interfaces to do "user mode" operations is a bad idea in general. But now I am fixing a version for Panther, it crashes at vn_open: user space app does: f = open(path, O_CREAT|O_RDWR|O_FSYNC, S_IRUSR|S_IWUSR); if ( f == -1 ) return nil; close(f); the kext is then called with the "path" to do the following: NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p); if ( (error = vn_open(&nd, FWRITE | O_FSYNC, 0)) != 0 ) ... And it paniced at vn_open. Anyone knows why? Since you have gone to the trouble of building a kext to communicate with your app, have the app pull the data from the kext, rather than have the kext write to the file; file I/O is the job of user-space apps. Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | Some people have a mental | horizon of radius zero, and | call it their point of view. | -- David Hilbert *--------------------------------------*-------------------------------* _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.