In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an alias
to fork. It is difficult to do real vfork in libc_r, since almost every operation with file descriptsor changes _thread_fd_table and friends. popen(3) works much better with this change.
This commit is contained in:
parent
48f4157055
commit
deb9688ae1
@ -29,7 +29,7 @@
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
SYSCALL(vfork)
|
||||
PSYSCALL(vfork)
|
||||
cmovne a4, zero, v0 /* a4 (rv[1]) != 0, child */
|
||||
RET
|
||||
END(vfork)
|
||||
PEND(vfork)
|
||||
|
@ -33,12 +33,12 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: Ovfork.S,v 1.6 1997/02/22 14:59:28 peter Exp $
|
||||
* $Id: Ovfork.S,v 1.7 1998/05/05 22:07:02 jb Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_RCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: Ovfork.S,v 1.6 1997/02/22 14:59:28 peter Exp $"
|
||||
.asciz "$Id: Ovfork.S,v 1.7 1998/05/05 22:07:02 jb Exp $"
|
||||
#endif /* SYSLIBC_RCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
@ -52,7 +52,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _THREAD_SAFE
|
||||
ENTRY(_thread_sys_vfork)
|
||||
#else
|
||||
ENTRY(vfork)
|
||||
#endif
|
||||
popl %ecx /* my rta into ecx */
|
||||
lea SYS_vfork,%eax
|
||||
KERNCALL
|
||||
|
@ -33,12 +33,12 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: Ovfork.S,v 1.6 1997/02/22 14:59:28 peter Exp $
|
||||
* $Id: Ovfork.S,v 1.7 1998/05/05 22:07:02 jb Exp $
|
||||
*/
|
||||
|
||||
#if defined(SYSLIBC_RCS) && !defined(lint)
|
||||
.text
|
||||
.asciz "$Id: Ovfork.S,v 1.6 1997/02/22 14:59:28 peter Exp $"
|
||||
.asciz "$Id: Ovfork.S,v 1.7 1998/05/05 22:07:02 jb Exp $"
|
||||
#endif /* SYSLIBC_RCS and not lint */
|
||||
|
||||
#include "DEFS.h"
|
||||
@ -52,7 +52,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef _THREAD_SAFE
|
||||
ENTRY(_thread_sys_vfork)
|
||||
#else
|
||||
ENTRY(vfork)
|
||||
#endif
|
||||
popl %ecx /* my rta into ecx */
|
||||
lea SYS_vfork,%eax
|
||||
KERNCALL
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.inc,v 1.13 1998/06/01 02:14:34 jb Exp $
|
||||
# $Id: Makefile.inc,v 1.14 1998/09/07 19:01:43 alex Exp $
|
||||
|
||||
# uthread sources
|
||||
.PATH: ${.CURDIR}/uthread
|
||||
@ -91,6 +91,7 @@ SRCS+= \
|
||||
uthread_spec.c \
|
||||
uthread_spinlock.c \
|
||||
uthread_suspend_np.c \
|
||||
uthread_vfork.c \
|
||||
uthread_wait4.c \
|
||||
uthread_write.c \
|
||||
uthread_writev.c \
|
||||
|
9
lib/libc_r/uthread/uthread_vfork.c
Normal file
9
lib/libc_r/uthread/uthread_vfork.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <unistd.h>
|
||||
#ifdef _THREAD_SAFE
|
||||
|
||||
int
|
||||
vfork(void)
|
||||
{
|
||||
return (fork());
|
||||
}
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.inc,v 1.13 1998/06/01 02:14:34 jb Exp $
|
||||
# $Id: Makefile.inc,v 1.14 1998/09/07 19:01:43 alex Exp $
|
||||
|
||||
# uthread sources
|
||||
.PATH: ${.CURDIR}/uthread
|
||||
@ -91,6 +91,7 @@ SRCS+= \
|
||||
uthread_spec.c \
|
||||
uthread_spinlock.c \
|
||||
uthread_suspend_np.c \
|
||||
uthread_vfork.c \
|
||||
uthread_wait4.c \
|
||||
uthread_write.c \
|
||||
uthread_writev.c \
|
||||
|
9
lib/libkse/thread/thr_vfork.c
Normal file
9
lib/libkse/thread/thr_vfork.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <unistd.h>
|
||||
#ifdef _THREAD_SAFE
|
||||
|
||||
int
|
||||
vfork(void)
|
||||
{
|
||||
return (fork());
|
||||
}
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.inc,v 1.13 1998/06/01 02:14:34 jb Exp $
|
||||
# $Id: Makefile.inc,v 1.14 1998/09/07 19:01:43 alex Exp $
|
||||
|
||||
# uthread sources
|
||||
.PATH: ${.CURDIR}/uthread
|
||||
@ -91,6 +91,7 @@ SRCS+= \
|
||||
uthread_spec.c \
|
||||
uthread_spinlock.c \
|
||||
uthread_suspend_np.c \
|
||||
uthread_vfork.c \
|
||||
uthread_wait4.c \
|
||||
uthread_write.c \
|
||||
uthread_writev.c \
|
||||
|
9
lib/libpthread/thread/thr_vfork.c
Normal file
9
lib/libpthread/thread/thr_vfork.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <unistd.h>
|
||||
#ifdef _THREAD_SAFE
|
||||
|
||||
int
|
||||
vfork(void)
|
||||
{
|
||||
return (fork());
|
||||
}
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user