2016-10-25 10:12:07 -04:00
|
|
|
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdbool.h>
|
2019-04-01 03:21:12 -04:00
|
|
|
#include <stdlib.h>
|
2019-12-10 07:50:04 -05:00
|
|
|
#include <stdarg.h>
|
2016-10-25 10:12:07 -04:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
2019-12-10 07:50:04 -05:00
|
|
|
#include <reent.h>
|
|
|
|
#include <sys/fcntl.h>
|
2017-09-05 05:29:57 -04:00
|
|
|
|
2016-10-25 10:12:07 -04:00
|
|
|
|
2019-12-01 13:20:52 -05:00
|
|
|
int system(const char* str)
|
|
|
|
{
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-10-25 10:12:07 -04:00
|
|
|
int _system_r(struct _reent *r, const char *str)
|
|
|
|
{
|
|
|
|
__errno_r(r) = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-12-01 13:20:52 -05:00
|
|
|
int raise(int sig)
|
|
|
|
{
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2018-07-31 05:08:04 -04:00
|
|
|
int _raise_r(struct _reent *r, int sig)
|
2016-10-25 10:12:07 -04:00
|
|
|
{
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
void* _sbrk_r(struct _reent *r, ptrdiff_t sz)
|
|
|
|
{
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
int _getpid_r(struct _reent *r)
|
|
|
|
{
|
|
|
|
__errno_r(r) = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int _kill_r(struct _reent *r, int pid, int sig)
|
|
|
|
{
|
|
|
|
__errno_r(r) = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _exit(int __status)
|
|
|
|
{
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2019-12-10 07:50:04 -05:00
|
|
|
/* Replaces newlib fcntl, which has been compiled without HAVE_FCNTL */
|
|
|
|
int fcntl(int fd, int cmd, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start(args, cmd);
|
|
|
|
int arg = va_arg(args, int);
|
|
|
|
va_end(args);
|
|
|
|
struct _reent* r = __getreent();
|
|
|
|
return _fcntl_r(r, fd, cmd, arg);
|
|
|
|
}
|
|
|
|
|
2019-04-01 03:21:12 -04:00
|
|
|
/* No-op function, used to force linking this file,
|
|
|
|
instead of the syscalls implementation from libgloss.
|
|
|
|
*/
|
2019-07-16 05:33:30 -04:00
|
|
|
void newlib_include_syscalls_impl(void)
|
2019-04-01 03:21:12 -04:00
|
|
|
{
|
|
|
|
}
|