That is rarely a good idea. But if you insist on doing it anyway,
you could use filp_open and the methods in the returned struct.
I have an old code example here:
http://www.daimi.au.dk/~kasperd/linux_kernel/kcp.c
-- Kasper Dupont -- der bruger for meget tid på usenet. For sending spam use mailto:aaarep@daimi.au.dk for(_=52;_;(_%5)||(_/=5),(_%5)&&(_-=2))putchar(_); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/