DIY Logging Volt/Ampmeter
syscalls.c File Reference

STM32CubeIDE Minimal System calls file. More...

#include <sys/stat.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/times.h>

Go to the source code of this file.

Functions

int __io_putchar (int ch) __attribute__((weak))
 
int __io_getchar (void)
 
void initialise_monitor_handles ()
 
int _getpid (void)
 
int _kill (int pid, int sig)
 
void _exit (int status)
 
 __attribute__ ((weak))
 
int _close (int file)
 
int _fstat (int file, struct stat *st)
 
int _isatty (int file)
 
int _lseek (int file, int ptr, int dir)
 
int _open (char *path, int flags,...)
 
int _wait (int *status)
 
int _unlink (char *name)
 
int _times (struct tms *buf)
 
int _stat (char *file, struct stat *st)
 
int _link (char *old, char *new)
 
int _fork (void)
 
int _execve (char *name, char **argv, char **env)
 

Variables

int errno
 
char ** environ = __env
 

Detailed Description

STM32CubeIDE Minimal System calls file.

Author
Auto-generated by STM32CubeIDE
       For more information about which c-functions
       need which of these lowlevel functions
       please consult the Newlib libc-manual
Attention

© Copyright (c) 2020 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file syscalls.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (weak)  )

Definition at line 69 of file syscalls.c.

70 {
71  int DataIdx;
72 
73  for (DataIdx = 0; DataIdx < len; DataIdx++)
74  {
75  *ptr++ = __io_getchar();
76  }
77 
78 return len;
79 }

◆ __io_getchar()

int __io_getchar ( void  )

Definition at line 39 of file syscalls.c.

43  { 0 };

◆ __io_putchar()

int __io_putchar ( int  ch)

◆ _close()

int _close ( int  file)

Definition at line 92 of file syscalls.c.

93 {
94  return -1;
95 }

◆ _execve()

int _execve ( char *  name,
char **  argv,
char **  env 
)

Definition at line 155 of file syscalls.c.

156 {
157  errno = ENOMEM;
158  return -1;
159 }

◆ _exit()

void _exit ( int  status)

Definition at line 63 of file syscalls.c.

64 {
65  _kill(status, -1);
66  while (1) {} /* Make sure we hang here */
67 }

◆ _fork()

int _fork ( void  )

Definition at line 149 of file syscalls.c.

150 {
151  errno = EAGAIN;
152  return -1;
153 }

◆ _fstat()

int _fstat ( int  file,
struct stat *  st 
)

Definition at line 98 of file syscalls.c.

99 {
100  st->st_mode = S_IFCHR;
101  return 0;
102 }

◆ _getpid()

int _getpid ( void  )

Definition at line 52 of file syscalls.c.

53 {
54  return 1;
55 }

◆ _isatty()

int _isatty ( int  file)

Definition at line 104 of file syscalls.c.

105 {
106  return 1;
107 }

◆ _kill()

int _kill ( int  pid,
int  sig 
)

Definition at line 57 of file syscalls.c.

58 {
59  errno = EINVAL;
60  return -1;
61 }

◆ _link()

int _link ( char *  old,
char *  new 
)

Definition at line 143 of file syscalls.c.

144 {
145  errno = EMLINK;
146  return -1;
147 }

◆ _lseek()

int _lseek ( int  file,
int  ptr,
int  dir 
)

Definition at line 109 of file syscalls.c.

110 {
111  return 0;
112 }

◆ _open()

int _open ( char *  path,
int  flags,
  ... 
)

Definition at line 114 of file syscalls.c.

115 {
116  /* Pretend like we always fail */
117  return -1;
118 }

◆ _stat()

int _stat ( char *  file,
struct stat *  st 
)

Definition at line 137 of file syscalls.c.

138 {
139  st->st_mode = S_IFCHR;
140  return 0;
141 }

◆ _times()

int _times ( struct tms *  buf)

Definition at line 132 of file syscalls.c.

133 {
134  return -1;
135 }

◆ _unlink()

int _unlink ( char *  name)

Definition at line 126 of file syscalls.c.

127 {
128  errno = ENOENT;
129  return -1;
130 }

◆ _wait()

int _wait ( int *  status)

Definition at line 120 of file syscalls.c.

121 {
122  errno = ECHILD;
123  return -1;
124 }

◆ initialise_monitor_handles()

void initialise_monitor_handles ( )

Definition at line 48 of file syscalls.c.

49 {
50 }

Variable Documentation

◆ environ

char** environ = __env

Definition at line 44 of file syscalls.c.

◆ errno

int errno
ptr
uint32_t volatile * ptr
Definition: cmsis_iccarm.h:558
_kill
int _kill(int pid, int sig)
Definition: syscalls.c:57
__io_getchar
int __io_getchar(void)
Definition: syscalls.c:39
errno
int errno