Re: no error thrown with exit(0) in the child process of vfork()

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

 



On Sat, 19 Jan 2013 08:40:04 +0530, you said:

> Is it that all the resources are shared as multiple references or if it is
> otherwise. Will you please give me some example of the case which I should
> not share the resources ? Thanking you all in advance.

It's not a question of "I should not share the resources" - fork() and friends
don't let you choose what to share or not share.  It's a matter of being
*aware* of what is or is not shared.  'man 2 fork' gives an extensive list of
what the child does and does not inherit.  Note that in some places it says
"inherits" - this usually refers to settings, and means "you get a copy of the
same value".  In places where it says "inherits copies", that means you got
another reference to the same object (mostly in regards to file system
objects).

The clone() syscall is useful if you wish to control what you do or don't
inherit from your parent.  It's also a very good way to shoot yourself in the
foot, as the semantics are subtly different from fork().

Attachment: pgptkqPrRF6v6.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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