www.delorie.com/djgpp/doc/libc/libc_124.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_crt0_startup_flags

Syntax

 
#include <crt0.h>

int _crt0_startup_flags = ...;

Description

This variable can be used to determine what the startup code will (or will not) do when the program begins. This can be used to tailor the startup environment to a particular program.

_CRT0_FLAG_PRESERVE_UPPER_CASE

If set, argv[0] is left in whatever case it was. If not set, all characters are mapped to lower case. Note that if the argv0 field in the stubinfo structure is present, the case of that part of argv[0] is not affected.

_CRT0_FLAG_USE_DOS_SLASHES

If set, reverse slashes (dos-style) are preserved in argv[0]. If not set, all reverse slashes are replaced with unix-style slashes.

_CRT0_FLAG_DROP_EXE_SUFFIX

If set, the `.exe' suffix is removed from the file name component of argv[0]. If not set, the suffix remains.

_CRT0_FLAG_DROP_DRIVE_SPECIFIER

If set, the drive specifier (e.g. `C:') is removed from the beginning of argv[0] (if present). If not set, the drive specifier remains.

_CRT0_FLAG_DISALLOW_RESPONSE_FILES

If set, response files (e.g. `@gcc.rf') are not expanded. If not set, the contents of the response files are used to create arguments. Note that if the file does not exist, that argument remains unexpanded.

_CRT0_FLAG_KEEP_QUOTES

If set, the quote characters `'', `"', and `\' will be retained in argv[] elements when processing command lines passed by DOS and via system. This is used by the redir program, and should only be needed if you want to get the original command line exactly as it was passed by the caller.

_CRT0_FLAG_FILL_SBRK_MEMORY

If set, fill sbrk'd memory with a constant value. If not, memory gets whatever happens to have been in there, which breaks some applications.

_CRT0_FLAG_FILL_DEADBEEF

If set, fill memory (above) with 0xdeadbeef, else fill with zero. This is especially useful for debugging uninitialized memory problems.

_CRT0_FLAG_NEARPTR

If set, set DS limit to 4GB which allows use of near pointers to DOS (and other) memory. WARNING, disables memory protection and bad pointers may crash the machine or wipe out your data. This flag is silently ignored on NT and DOSEmu, which disallow such huge selector limits.

_CRT0_FLAG_NULLOK

If set, disable NULL pointer protection (if it can be controlled at all).

_CRT0_FLAG_NMI_SIGNAL

If set, enabled capture of NMI in exception code. This may cause problems with laptops and "green" boxes which use it to wake up. Default is to leave NMIs alone and pass through to real mode code. You decide.

_CRT0_FLAG_NO_LFN

If set, disable usage of long file name functions even on systems (such as Windows 9X) which support them. This might be needed to work around program assumptions on file name format on programs written specifically for DOS. Note that this flag overrides the value of the environment variable LFN.

_CRT0_FLAG_NONMOVE_SBRK

If set, the sbrk algorithm uses multiple DPMI memory blocks which makes sure the base of CS/DS/SS does not change. This may cause problems with sbrk(0) values and programs with other assumptions about sbrk behavior. This flag is useful with near pointers, since a constant pointer to DOS/Video memory can be computed without needing to reload it after any routine which might call sbrk.

_CRT0_FLAG_UNIX_SBRK

If set, the sbrk algorithm resizes memory blocks so that the layout of memory is set up to be the most compatible with Unix sbrk expectations. This mode should not be used with hardware interrupts, near pointers, and may cause problems with QDPMI virtual memory.

If your program requires a specific sbrk behavior, you should set either this or the previous flag, since the default may change in different libc releases.

_CRT0_DISABLE_SBRK_ADDRESS_WRAP

If set, non-move sbrk should discard (ignore) memory blocks which are returned by DPMI which would require address wrap to access (at addresses below the CS/DS base address). This bit is automatically set on Windows NT systems which require it. It may be manually set on other systems which don't require it to retain a more normal memory space layout and better memory protection. This bit can be set but should never be cleared.

_CRT0_FLAG_LOCK_MEMORY

If set, locks all memory as it is allocated. This effectively disables virtual memory, and may be useful if using extensive hardware interrupt codes in a relatively small image size. The memory is locked after it is sbrk'ed, so the locking may fail. This bit may be set or cleared during execution. When sbrk uses multiple memory zones, it can be difficult to lock all memory since the memory block size and location is impossible to determine.

_CRT0_FLAG_PRESERVE_FILENAME_CASE

If set, disables all filename letter-case conversions in functions that traverse directories (except findfirst/findnext which always return the filenames exactly as found in the directory entry). When reset, all filenames on 8+3 MSDOS filesystems and DOS-style 8+3 filenames on LFN systems are converted to lower-case by functions such as `readdir', getcwd, _fixpath and others. Note that when this flag is set, ALL filenames on MSDOS systems will appear in upper-case, which is both ugly and will break many Unix-born programs. Use only if you know exactly what you are doing!

This flag overrides the value of the environment variable `FNCASE', See section _preserve_fncase.

Portability

ANSI/ISO C No
POSIX No


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004