-/* $OpenBSD: init.c,v 1.12 2023/01/16 07:09:12 guenther Exp $ */
+/* $OpenBSD: init.c,v 1.13 2023/02/21 14:41:51 deraadt Exp $ */
/*
* Copyright (c) 2014,2015 Philip Guenther <guenther@openbsd.org>
*
return &environ;
}
+int pinsyscall(int, void *, size_t);
+PROTO_NORMAL(pinsyscall);
+
+int HIDDEN(execve)(const char *, char *const *, char *const *)
+ __attribute__((weak));
+
#ifndef PIC
/*
* static libc in a static link? Then set up __progname and environ
{
static char progname_storage[NAME_MAX+1];
+ /* XXX 128 maximum size of a system call stub, hopefully */
+ if (&HIDDEN(execve))
+ pinsyscall(SYS_execve, &HIDDEN(execve), 128);
+
environ = envp;
/* set up __progname */