Where is the implement of fork() function?

I have great interest in the implement of fork() function, but after downloading the source file, I can't find the exact file. Can anybody tell me which file should I look?
[180 byte] By [HotFirea] at [2007-11-26 22:45:41]
# 1

Perhaps this is what you are looking for:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/thr eads/scalls.c#_private_forkx

> ... after downloading the source file ...

You can browse the source code online through the following URL:

http://src.opensolaris.org/source/

giri04a at 2007-7-10 12:03:17 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
Hello.If you want to look at that what happens inside the OS kernel:You'll find it at: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/for k.cMartin
Martin_Rosenaua at 2007-7-10 12:03:17 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
Thank you for your reply, but I am still confused. I can't find the definition of fork() function but only fork1() function. I know that fork() equals to fork1(). Is fork() just a macro?
HotFirea at 2007-7-10 12:03:17 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

Hello.

No. The first answer was what you are looking for:

scalls.c contains the following lines:

#pragma weak fork = _fork

pid_t

_fork(void)

{

return (_private_forkx(0));

}

The "#pragma weak fork = _fork" means:

If there is no other library defining a "fork" symbol then "fork" is equal to "_fork". This allows other libraries to "overwrite" "fork".

(This "overwriting" can be done when loading the executable and the .so files.)

Martin

Martin_Rosenaua at 2007-7-10 12:03:17 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5
I see. Thanks!
HotFirea at 2007-7-10 12:03:17 > top of Java-index,Solaris Operating System,Solaris 10 Features...