|
Re: create shared mem in mpc85xx_attach, where to destroy the mem?
|
08/07/2012 12:44 PM
post94677
|
Re: create shared mem in mpc85xx_attach, where to destroy the mem?
The file will only be removed once all references to it have been removed,
so if another process has the filename open, it will only be removed once
that process releases it.
On 2012-08-07 12:40 PM, "Wen Xu" <community-noreply@qnx.com> wrote:
>> You would do this in the mpc85xx_stop routine.
>>
>>
>>
>>
>> On 2012-08-06 5:39 PM, "Wen Xu" <community-noreply@qnx.com> wrote:
>>
>> >Hi,
>> >
>> >I created a shared mem object by calling shm_open() in the function
>> >mpc85xx_attach() e.g.
>> >
>> > fd = shm_open( fileName, O_RDWR | O_CREAT, 0777 );
>> >
>> >I wish to destroy this shared mem object when io-pkt-v4 exits for some
>> >reason (e.g. being slayed).
>> >
>> >In which function should I call the function shm_unlink(fileName);
>> >
>> >Thanks.
>> >
>> >
>> >
>
>
>Thanks. As suggested shm_unlink() is called in the function
>mpc85xx_stop().
>However, after I issue the command "slay io-pkt-v4", this shared mem
>object is still accessible
>from another process. Would you please suggest why the share mem object
>is not destroyed successfully?
>
>e.g.
>
>static void
>mpc85xx_stop(struct ifnet *ifp, int disable)
>{
>....
>if (disable)
>{
>shm_unlink(fileName);
>}
>}
>
>
>
>
>
>_______________________________________________
>
>Networking Drivers
>http://community.qnx.com/sf/go/post94676
>To cancel your subscription to this discussion, please e-mail
>drivers-networking-unsubscribe@community.qnx.com
|
|
|