crt1_c.o crt1_s.o gcrtl_c.o Scrt1_c.o
WARNS?= 2
-CFLAGS+= -I${CSUDIR}/../common
+CFLAGS+= -I${CSUDIR}/../common \
+ -I${CSUDIR}/../../libc/include
.PATH: ${CSUDIR} ${CSUDIR}/../common
#include <machine/tls.h>
#include <stddef.h>
#include <stdlib.h>
+
+#include "libc_private.h"
#include "crtbrand.c"
+extern int _DYNAMIC;
+#pragma weak _DYNAMIC
+
typedef void (*fptr)(void);
extern void _fini(void);
extern int etext;
#endif
-extern int _DYNAMIC;
-#pragma weak _DYNAMIC
-
char **environ;
-char *__progname = "";
+const char *__progname = "";
+
void _start1(fptr, int, char *[]) __dead2;
+/* The entry function, C part. */
void
_start1(fptr cleanup, int argc, char *argv[])
{
char **env;
+ const char *s;
env = argv + argc + 1;
environ = env;
- if(argc > 0 && argv[0] != NULL) {
- char *s;
+ if (argc > 0 && argv[0] != NULL) {
__progname = argv[0];
for (s = __progname; *s != '\0'; s++)
if (*s == '/')
* SUCH DAMAGE.
*
* $FreeBSD: src/lib/libc/gen/getlogin.c,v 1.4.2.1 2001/03/05 09:06:50 obrien Exp $
- * $DragonFly: src/lib/libc/gen/getlogin.c,v 1.4 2005/04/26 06:08:42 joerg Exp $
*
* @(#)getlogin.c 8.1 (Berkeley) 6/4/93
*/
#include <pthread.h>
#include "un-namespace.h"
-#include <libc_private.h>
+#include "libc_private.h"
#define THREAD_LOCK() if (__isthreaded) _pthread_mutex_lock(&logname_mutex)
#define THREAD_UNLOCK() if (__isthreaded) _pthread_mutex_unlock(&logname_mutex)
/*
* $FreeBSD: src/lib/libc/gen/setprogname.c,v 1.1.2.4 2002/02/11 01:18:35 dd Exp $
- * $DragonFly: src/lib/libc/gen/setprogname.c,v 1.2 2003/06/17 04:26:42 dillon Exp $
*/
#include <stdlib.h>
#include <string.h>
-extern const char *__progname;
+#include "libc_private.h"
void
setprogname(const char *progname)
* This is a pointer in the C run-time startup code. It is used
* by getprogname() and setprogname().
*/
-extern const char *__progname;
+const char *__progname;
/*
* Function to clean up streams, called from abort() and exit().