Re: Is drivers' open() method get called while fork or dup fd?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter, nice to see your reply again. I haven't check my mailbox for several days.

Yes, I think , it's normally thinked as a generic rule to do kernel programming 
like that way you mentioned. But if we take no account of these, do you know the 
answer of my question, is the open() method got called in fork() and dup() functions 
calling??

I haven't find the answer, some stuff pointed that the open file descriptor will be 
inheritted into child process when forking, but I dont know the detail infor about this,
can you explain?

>> normally process-specific information should be stored in userspace's
>> process.   and if necessary inter-process communication setup to share
>> the variable values.   kernel should preferably be used for security
>> related, or non-per-process specific stuff.   this is because anything
>> u do in the kernel, is visible to every party in the kernel.....and
>> many other reasons as well...
>> 
>> 2009/4/15 yihect <yihect@xxxxxxx>:
>>> I want to store some process-dependent information in my driver. I want to
>>> init them in open() and
>>> deinit them in flush(), these 2 methods get called when the app process
>>> calling open() or close() functions.
>>>
>>> But if one parent process forked child process with my driver opened. Than,
>>> is the open() method get called?
>>> I want to store child-process-dependent as well.
>>>
>>> How about in dup() ?? Will the open() get called in this case? thanks.
>> 
>> 
>> 
>> -- 
>> Regards,
>> Peter Teoh

yihect Chenÿôèº{.nÇ+?·?®?­?+%?Ëÿ±éÝjw¦j)p?Øÿº{.nÇ+?·¤z¹Þ?w°n'¬þÚqªí?Ïç?ùb?ìÿ¢¸?æ¬z·?vØ^¶m§ÿÿ?êçzYÞÁ¸?³ú+?ñ@


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux