cenv.9.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. CENV(9)
  2. ========
  3. :doctype: manpage
  4. :man source: X15
  5. :man manual: X15 C environment
  6. NAME
  7. ----
  8. cenv - C environment
  9. DESCRIPTION
  10. -----------
  11. This document describes the C environment of the kernel, including
  12. available standard headers and interfaces.
  13. Standard
  14. ~~~~~~~~
  15. X15 must be built with a C compiler supporting the ISO/IEC 9899:2011
  16. (C11) specification with some GCC extensions. It can currently be built
  17. with the GCC and Clang compilers.
  18. Environment
  19. ~~~~~~~~~~~
  20. The kernel uses the freestanding execution environment. This means the
  21. compiler is expected to provide the following headers :
  22. ** cheader:float
  23. ** cheader:iso646
  24. ** cheader:limits
  25. ** cheader:stdalign
  26. ** cheader:stdarg
  27. ** cheader:stdbool
  28. ** cheader:stddef
  29. ** cheader:stdint
  30. ** cheader:stdnoreturn
  31. X15 augments the environment with a small subset of the functions provided
  32. in hosted environments. The additional headers are :
  33. ** cheader:assert
  34. ** cheader:errno
  35. ** cheader:limits
  36. ** cheader:stdio
  37. ** cheader:string
  38. Note that these headers do not provide the complete set of interfaces
  39. expected in a hosted environment.
  40. Formatting functions
  41. ~~~~~~~~~~~~~~~~~~~~
  42. Of particular interest is the cheader:stdio header which provides a subset
  43. of the printf and scanf family of functions.
  44. The supported functions are :
  45. ** cfunction:getchar
  46. ** cfunction:putchar
  47. ** cfunction:sprintf
  48. ** cfunction:snprintf
  49. ** cfunction:vsprintf
  50. ** cfunction:vsnprintf
  51. ** cfunction:sscanf
  52. ** cfunction:vsscanf
  53. The *EOF* macro is also provided.
  54. The formatting functions only implement a subset of what the standard
  55. defines, namely :
  56. ** cfunction:sprintf :
  57. *** flags: # 0 - ' ' (space) +
  58. *** field width is supported
  59. *** precision is supported
  60. ** cfunction:sscanf :
  61. *** flags: *
  62. *** field width is supported
  63. ** common to both :
  64. *** modifiers: hh h l ll z t
  65. *** specifiers: d i o u x X c s p n %
  66. Floating point conversions are currently not supported, but this may change
  67. in the future.
  68. SEE
  69. ---
  70. manpage:intro
  71. {x15-operating-system}