Keil Logo


4.39 _sys_command_string()

Defined in rt_sys.h, the _sys_command_string() function retrieves the command line that invoked the current application from the environment that called the application.


char *_sys_command_string(char *cmd, int len);
is a pointer to a buffer that can store the command line. It is not required that the command line is stored in cmd.
is the length of the buffer.


This function is called by the library startup code to set up argv and argc to pass to main().


You must not assume that the C library is fully initialized when this function is called. For example, you must not call malloc() from within this function. This is because the C library startup sequence calls this function before the heap is fully configured.


The function must return either:
  • A pointer to the command line, if successful. This can be either a pointer to the cmd buffer if it is used, or a pointer to wherever else the command line is stored.
  • NULL, if not successful.
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.