Blame sysdeps/unix/sysv/linux/m68k/vfork.S

Packit Service 82fcde
/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
   Contributed by Andreas Schwab <schwab@gnu.org>.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library.  If not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#include <sysdep.h>
Packit Service 82fcde
#define _ERRNO_H	1
Packit Service 82fcde
#include <bits/errno.h>
Packit Service 82fcde
#include <tcb-offsets.h>
Packit Service 82fcde
Packit Service 82fcde
/* Clone the calling process, but without copying the whole address space.
Packit Service 82fcde
   The calling process is suspended until the new process exits or is
Packit Service 82fcde
   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
Packit Service 82fcde
   and the process ID of the new process to the old process.  */
Packit Service 82fcde
Packit Service 82fcde
ENTRY (__vfork)
Packit Service 82fcde
Packit Service 82fcde
	/* Pop the return PC value into A0.  */
Packit Service 82fcde
	movel	%sp@+, %a0
Packit Service 82fcde
	cfi_adjust_cfa_offset (-4)
Packit Service 82fcde
	cfi_register (%pc, %a0)
Packit Service 82fcde
Packit Service 82fcde
	/* Stuff the syscall number in D0 and trap into the kernel.  */
Packit Service 82fcde
	movel	#SYS_ify (vfork), %d0
Packit Service 82fcde
	trap	#0
Packit Service 82fcde
Packit Service 82fcde
	tstl	%d0
Packit Service 82fcde
	jmi	.Lerror		/* Branch forward if it failed.  */
Packit Service 82fcde
Packit Service 82fcde
	/* Jump to the return PC.  */
Packit Service 82fcde
	jmp	%a0@
Packit Service 82fcde
Packit Service 82fcde
.Lerror:
Packit Service 82fcde
	/* Push back the return PC.  */
Packit Service 82fcde
	movel	%a0,%sp@-
Packit Service 82fcde
	cfi_adjust_cfa_offset (4)
Packit Service 82fcde
	cfi_rel_offset (%pc, 0)
Packit Service 82fcde
Packit Service 82fcde
#ifndef PIC
Packit Service 82fcde
	jbra	SYSCALL_ERROR_LABEL
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
PSEUDO_END (__vfork)
Packit Service 82fcde
libc_hidden_def (__vfork)
Packit Service 82fcde
Packit Service 82fcde
weak_alias (__vfork, vfork)
Packit Service 82fcde
strong_alias (__vfork, __libc_vfork)