GPS Device
Loading...
Searching...
No Matches
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>
Include dependency graph for syscalls.c:

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)
void * _sbrk (ptrdiff_t incr)

Variables

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-2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file syscalls.c.

Function Documentation

◆ __io_getchar()

int __io_getchar ( void )
extern

Definition at line 36 of file syscalls.c.

39 { 0 };

◆ initialise_monitor_handles()

void initialise_monitor_handles ( )

Definition at line 44 of file syscalls.c.

45{
46}

◆ _getpid()

int _getpid ( void )

Definition at line 48 of file syscalls.c.

49{
50 return 1;
51}

◆ _kill()

int _kill ( int pid,
int sig )

Definition at line 53 of file syscalls.c.

54{
55 (void)pid;
56 (void)sig;
57 errno = EINVAL;
58 return -1;
59}

◆ _exit()

void _exit ( int status)

Definition at line 61 of file syscalls.c.

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

◆ __attribute__()

__attribute__ ( (weak) )

Definition at line 67 of file syscalls.c.

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

◆ _close()

int _close ( int file)

Definition at line 92 of file syscalls.c.

93{
94 (void)file;
95 return -1;
96}

◆ _fstat()

int _fstat ( int file,
struct stat * st )

Definition at line 99 of file syscalls.c.

100{
101 (void)file;
102 st->st_mode = S_IFCHR;
103 return 0;
104}

◆ _isatty()

int _isatty ( int file)

Definition at line 106 of file syscalls.c.

107{
108 (void)file;
109 return 1;
110}

◆ _lseek()

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

Definition at line 112 of file syscalls.c.

113{
114 (void)file;
115 (void)ptr;
116 (void)dir;
117 return 0;
118}

◆ _open()

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

Definition at line 120 of file syscalls.c.

121{
122 (void)path;
123 (void)flags;
124 /* Pretend like we always fail */
125 return -1;
126}

◆ _wait()

int _wait ( int * status)

Definition at line 128 of file syscalls.c.

129{
130 (void)status;
131 errno = ECHILD;
132 return -1;
133}

◆ _unlink()

int _unlink ( char * name)

Definition at line 135 of file syscalls.c.

136{
137 (void)name;
138 errno = ENOENT;
139 return -1;
140}

◆ _times()

int _times ( struct tms * buf)

Definition at line 142 of file syscalls.c.

143{
144 (void)buf;
145 return -1;
146}

◆ _stat()

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

Definition at line 148 of file syscalls.c.

149{
150 (void)file;
151 st->st_mode = S_IFCHR;
152 return 0;
153}

◆ _link()

int _link ( char * old,
char * new )

Definition at line 155 of file syscalls.c.

156{
157 (void)old;
158 (void)new;
159 errno = EMLINK;
160 return -1;
161}

◆ _fork()

int _fork ( void )

Definition at line 163 of file syscalls.c.

164{
165 errno = EAGAIN;
166 return -1;
167}

◆ _execve()

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

Definition at line 169 of file syscalls.c.

170{
171 (void)name;
172 (void)argv;
173 (void)env;
174 errno = ENOMEM;
175 return -1;
176}

◆ _sbrk()

void * _sbrk ( ptrdiff_t incr)

Definition at line 178 of file syscalls.c.

179{
180 (void)incr;
181 return (void *)-1;
182}

Variable Documentation

◆ environ

char** environ = __env

Definition at line 40 of file syscalls.c.