1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Fixed two linker errors which were caused by duplicate symbol definitions.

- Added code to the startup routine which allows you to monitor where command
  was started from and which parameters it was invoked with.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14925 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-04-24 14:04:36 +00:00
parent 876039440f
commit 9f3d5e50b4
5 changed files with 56 additions and 15 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.48 2005-04-03 10:22:47 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.49 2005-04-24 14:04:36 obarthel Exp $
#
# :ts=8
#
@ -929,6 +929,8 @@ $(LIBAMIGA_OBJS)/amiga.lib_rev.o : amiga.lib_rev.c amiga.lib_rev.h
$(LIBC_OBJS)/stdlib_stacksize.o : stdlib_stacksize.c stdlib_gcc_help.h
$(LIBC_OBJS)/stdlib_getdefstacksize.o : stdlib_getdefstacksize.c stdlib_gcc_help.h
$(LIBC_OBJS)/stdlib_shell_escape.o : stdlib_shell_escape.c stdlib_gcc_help.h
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h

View File

@ -1,5 +1,5 @@
/*
* $Id: stat_umask.c,v 1.4 2005-03-09 10:48:59 obarthel Exp $
* $Id: stat_umask.c,v 1.5 2005-04-24 14:04:36 obarthel Exp $
*
* :ts=4
*
@ -41,6 +41,10 @@
/****************************************************************************/
mode_t __current_umask = S_IWGRP | S_IWOTH;
/****************************************************************************/
#if defined(USERGROUP_SUPPORT)
/****************************************************************************/
@ -51,10 +55,6 @@
/****************************************************************************/
mode_t __current_umask = S_IWGRP | S_IWOTH;
/****************************************************************************/
mode_t
umask(mode_t new_mask)
{

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_getdefstacksize.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $
* $Id: stdlib_getdefstacksize.c,v 1.3 2005-04-24 14:04:36 obarthel Exp $
*
* :ts=4
*
@ -37,4 +37,14 @@
/****************************************************************************/
#ifndef _STDLIB_GCC_HELP_H
#include "stdlib_gcc_help.h"
#endif /* _STDLIB_GCC_HELP_H */
/****************************************************************************/
#ifndef GCC_HELP_SUPPORT
unsigned int (* __get_default_stack_size)(void);
#endif /* GCC_HELP_SUPPORT */

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_main.c,v 1.23 2005-04-04 11:56:22 obarthel Exp $
* $Id: stdlib_main.c,v 1.24 2005-04-24 14:04:36 obarthel Exp $
*
* :ts=4
*
@ -90,6 +90,39 @@ call_main(void)
call chains, switch it on now. */
__show_profile_names();
/* This can be helpful for debugging purposes: print the name of the current
directory, followed by the name of the command and all the parameters
passed to it. */
#ifndef NDEBUG
{
UBYTE value_str[10];
LONG value;
/* Careful: only echo this information if a global environment
variable is set to enable this feature! */
if(GetVar("_echo",value_str,sizeof(value_str),GVF_GLOBAL_ONLY) > 0 && StrToLong(value_str,&value) > 0 && value != 0)
{
struct Process * this_process = (struct Process *)FindTask(NULL);
UBYTE * arg_str = GetArgStr();
size_t arg_str_len = strlen(arg_str);
UBYTE * arg_str_copy = AllocVec(arg_str_len+1,MEMF_ANY);
UBYTE current_dir_name[256];
if(arg_str_copy != NULL && NameFromLock(this_process->pr_CurrentDir,current_dir_name,sizeof(current_dir_name)))
{
strcpy(arg_str_copy,arg_str);
while(arg_str_len > 0 && arg_str_copy[arg_str_len-1] <= ' ')
arg_str_copy[--arg_str_len] = '\0';
kprintf("[%s] %s %s\n",current_dir_name,__program_name,arg_str_copy);
}
FreeVec(arg_str_copy);
}
}
#endif /* NDEBUG */
/* After all these preparations, get this show on the road... */
exit(main((int)__argc,(char **)__argv));
@ -268,8 +301,8 @@ get_stack_size(void)
int
_main(void)
{
volatile struct Process * child_process = NULL;
volatile struct WBStartup * startup_message;
struct Process * volatile child_process = NULL;
struct WBStartup * volatile startup_message;
volatile APTR old_window_pointer = NULL;
volatile BOOL old_window_pointer_valid = FALSE;
struct Process * this_process;

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib_stack_usage.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* $Id: stdlib_stack_usage.c,v 1.6 2005-04-24 14:04:36 obarthel Exp $
*
* :ts=4
*
@ -43,13 +43,9 @@ static struct StackSwapStruct stack_swap_struct;
/****************************************************************************/
#if defined(__SASC)
ULONG __stk_extensions; /* number of stack extensions performed */
ULONG __stk_maxsize; /* maximum amount of memory allocated for stack extension */
#endif /* __SASC */
/****************************************************************************/
#define STACK_FILL_COOKIE 0xA1