12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #include <stdarg.h>
- #include <sysdep.h>
- #include <unistd.h>
- extern int __or1k_clone (int (*fn)(void *), void *child_stack,
- int flags, void *arg, pid_t *ptid,
- void *tls, pid_t *ctid);
- int
- __clone (int (*fn)(void *), void *child_stack,
- int flags, void *arg, ...
- )
- {
- void *ptid;
- void *tls;
- void *ctid;
- va_list ap;
- int err;
- va_start (ap, arg);
- ptid = va_arg (ap, void *);
- tls = va_arg (ap, void *);
- ctid = va_arg (ap, void *);
- va_end (ap);
-
- err = -EINVAL;
- if (!fn)
- goto syscall_error;
- if (!child_stack)
- goto syscall_error;
- return __or1k_clone (fn, child_stack, flags, arg, ptid, tls, ctid);
- syscall_error:
- __set_errno (-err);
- return -1;
- }
- weak_alias (__clone, clone)
|