L4Re/OLD/libc_newlib

Changeset

24:bd0ba663b850
2019-10-18 Paul Boddie raw files shortlog changelog graph Moved various other system functions into separate, specific files.
libc/l4re/sys_client.c (file) libc/l4re/sys_client.h (file) libc/l4re/sys_process.c (file) libc/l4re/sys_process.h (file) libc/l4re/sys_time.c (file) libc/l4re/sys_time.h (file) libc/l4re/syscalls.c (file)
     1.1 --- a/libc/l4re/sys_client.c	Fri Oct 18 17:29:17 2019 +0200
     1.2 +++ b/libc/l4re/sys_client.c	Fri Oct 18 20:38:32 2019 +0200
     1.3 @@ -114,6 +114,11 @@
     1.4    return -1;
     1.5  }
     1.6  
     1.7 +int _isatty_r(struct _reent *reent, int fd)
     1.8 +{
     1.9 +  return 0;
    1.10 +}
    1.11 +
    1.12  int _link_r(struct _reent *reent, const char *oldpath, const char *newpath)
    1.13  {
    1.14    return -1;
     2.1 --- a/libc/l4re/sys_client.h	Fri Oct 18 17:29:17 2019 +0200
     2.2 +++ b/libc/l4re/sys_client.h	Fri Oct 18 20:38:32 2019 +0200
     2.3 @@ -28,6 +28,7 @@
     2.4  
     2.5  int _close_r(struct _reent *reent, int fd);
     2.6  int _fstat_r(struct _reent *reent, int fd, struct stat *buf);
     2.7 +int _isatty_r(struct _reent *reent, int fd);
     2.8  int _link_r(struct _reent *reent, const char *oldpath, const char *newpath);
     2.9  off_t _lseek_r(struct _reent *reent, int fd, off_t offset, int whence);
    2.10  int _open_r(struct _reent *reent, const char *name, int flags, int mode);
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libc/l4re/sys_process.c	Fri Oct 18 20:38:32 2019 +0200
     3.3 @@ -0,0 +1,52 @@
     3.4 +/*
     3.5 + * Process-related system functions.
     3.6 + *
     3.7 + * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     3.8 + *
     3.9 + * This program is free software; you can redistribute it and/or
    3.10 + * modify it under the terms of the GNU General Public License as
    3.11 + * published by the Free Software Foundation; either version 2 of
    3.12 + * the License, or (at your option) any later version.
    3.13 + *
    3.14 + * This program is distributed in the hope that it will be useful,
    3.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.17 + * GNU General Public License for more details.
    3.18 + *
    3.19 + * You should have received a copy of the GNU General Public License
    3.20 + * along with this program; if not, write to the Free Software
    3.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    3.22 + * Boston, MA  02110-1301, USA
    3.23 + */
    3.24 +
    3.25 +#include "sys_process.h"
    3.26 +
    3.27 +int _execve(const char *name, char *const argv[], char *const env[])
    3.28 +{
    3.29 +  return -1;
    3.30 +}
    3.31 +
    3.32 +int _execve_r(struct _reent *reent, const char *name, char *const argv[], char *const env[])
    3.33 +{
    3.34 +  return -1;
    3.35 +}
    3.36 +
    3.37 +pid_t _fork_r(struct _reent *reent)
    3.38 +{
    3.39 +  return (pid_t) -1;
    3.40 +}
    3.41 +
    3.42 +pid_t _getpid_r(struct _reent *reent)
    3.43 +{
    3.44 +  return (pid_t) 0;
    3.45 +}
    3.46 +
    3.47 +int _kill_r(struct _reent *reent, pid_t pid, int sig)
    3.48 +{
    3.49 +  return -1;
    3.50 +}
    3.51 +
    3.52 +pid_t _wait_r(struct _reent *reent, int *wstatus)
    3.53 +{
    3.54 +  return (pid_t) -1;
    3.55 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/libc/l4re/sys_process.h	Fri Oct 18 20:38:32 2019 +0200
     4.3 @@ -0,0 +1,35 @@
     4.4 +/*
     4.5 + * Process-related system functions.
     4.6 + *
     4.7 + * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     4.8 + *
     4.9 + * This program is free software; you can redistribute it and/or
    4.10 + * modify it under the terms of the GNU General Public License as
    4.11 + * published by the Free Software Foundation; either version 2 of
    4.12 + * the License, or (at your option) any later version.
    4.13 + *
    4.14 + * This program is distributed in the hope that it will be useful,
    4.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.17 + * GNU General Public License for more details.
    4.18 + *
    4.19 + * You should have received a copy of the GNU General Public License
    4.20 + * along with this program; if not, write to the Free Software
    4.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    4.22 + * Boston, MA  02110-1301, USA
    4.23 + */
    4.24 +
    4.25 +#pragma once
    4.26 +
    4.27 +#include <sys/types.h>
    4.28 +#include <sys/wait.h>
    4.29 +#include <unistd.h>
    4.30 +
    4.31 +#include <reent.h>            /* struct _reent */
    4.32 +
    4.33 +int _execve(const char *name, char *const argv[], char *const env[]);
    4.34 +int _execve_r(struct _reent *reent, const char *name, char *const argv[], char *const env[]);
    4.35 +pid_t _fork_r(struct _reent *reent);
    4.36 +pid_t _getpid_r(struct _reent *reent);
    4.37 +int _kill_r(struct _reent *reent, pid_t pid, int sig);
    4.38 +pid_t _wait_r(struct _reent *reent, int *wstatus);
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/libc/l4re/sys_time.c	Fri Oct 18 20:38:32 2019 +0200
     5.3 @@ -0,0 +1,32 @@
     5.4 +/*
     5.5 + * Time-related system functions.
     5.6 + *
     5.7 + * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     5.8 + *
     5.9 + * This program is free software; you can redistribute it and/or
    5.10 + * modify it under the terms of the GNU General Public License as
    5.11 + * published by the Free Software Foundation; either version 2 of
    5.12 + * the License, or (at your option) any later version.
    5.13 + *
    5.14 + * This program is distributed in the hope that it will be useful,
    5.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.17 + * GNU General Public License for more details.
    5.18 + *
    5.19 + * You should have received a copy of the GNU General Public License
    5.20 + * along with this program; if not, write to the Free Software
    5.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    5.22 + * Boston, MA  02110-1301, USA
    5.23 + */
    5.24 +
    5.25 +#include "sys_time.h"
    5.26 +
    5.27 +int _gettimeofday_r(struct _reent *reent, struct timeval *tv, void *tz)
    5.28 +{
    5.29 +  return -1;
    5.30 +}
    5.31 +
    5.32 +clock_t _times_r(struct _reent *reent, struct tms *buf)
    5.33 +{
    5.34 +  return (clock_t) -1;
    5.35 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/libc/l4re/sys_time.h	Fri Oct 18 20:38:32 2019 +0200
     6.3 @@ -0,0 +1,30 @@
     6.4 +/*
     6.5 + * Time-related system functions.
     6.6 + *
     6.7 + * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     6.8 + *
     6.9 + * This program is free software; you can redistribute it and/or
    6.10 + * modify it under the terms of the GNU General Public License as
    6.11 + * published by the Free Software Foundation; either version 2 of
    6.12 + * the License, or (at your option) any later version.
    6.13 + *
    6.14 + * This program is distributed in the hope that it will be useful,
    6.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.17 + * GNU General Public License for more details.
    6.18 + *
    6.19 + * You should have received a copy of the GNU General Public License
    6.20 + * along with this program; if not, write to the Free Software
    6.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    6.22 + * Boston, MA  02110-1301, USA
    6.23 + */
    6.24 +
    6.25 +#pragma once
    6.26 +
    6.27 +#include <sys/time.h>
    6.28 +#include <sys/times.h>
    6.29 +
    6.30 +#include <reent.h>            /* struct _reent */
    6.31 +
    6.32 +int _gettimeofday_r(struct _reent *reent, struct timeval *tv, void *tz);
    6.33 +clock_t _times_r(struct _reent *reent, struct tms *buf);
     7.1 --- a/libc/l4re/syscalls.c	Fri Oct 18 17:29:17 2019 +0200
     7.2 +++ b/libc/l4re/syscalls.c	Fri Oct 18 20:38:32 2019 +0200
     7.3 @@ -19,64 +19,13 @@
     7.4   * Boston, MA  02110-1301, USA
     7.5   */
     7.6  
     7.7 -#include <sys/time.h>
     7.8 -#include <sys/times.h>
     7.9  #include <sys/types.h>
    7.10 -#include <sys/wait.h>
    7.11 -#include <unistd.h>
    7.12 -
    7.13 -#include <reent.h>            /* struct _reent */
    7.14 -
    7.15 -int _execve(const char *name, char *const argv[], char *const env[])
    7.16 -{
    7.17 -  return -1;
    7.18 -}
    7.19 -
    7.20 -int _execve_r(struct _reent *reent, const char *name, char *const argv[], char *const env[])
    7.21 -{
    7.22 -  return -1;
    7.23 -}
    7.24  
    7.25  void _exit(int status)
    7.26  {
    7.27  }
    7.28  
    7.29 -pid_t _fork_r(struct _reent *reent)
    7.30 -{
    7.31 -  return (pid_t) -1;
    7.32 -}
    7.33 -
    7.34  int getentropy(void *buffer, size_t length)
    7.35  {
    7.36    return -1;
    7.37  }
    7.38 -
    7.39 -pid_t _getpid_r(struct _reent *reent)
    7.40 -{
    7.41 -  return (pid_t) 0;
    7.42 -}
    7.43 -
    7.44 -int _gettimeofday_r(struct _reent *reent, struct timeval *tv, void *tz)
    7.45 -{
    7.46 -  return -1;
    7.47 -}
    7.48 -
    7.49 -int _isatty_r(struct _reent *reent, int fd)
    7.50 -{
    7.51 -  return 0;
    7.52 -}
    7.53 -
    7.54 -int _kill_r(struct _reent *reent, pid_t pid, int sig)
    7.55 -{
    7.56 -  return -1;
    7.57 -}
    7.58 -
    7.59 -clock_t _times_r(struct _reent *reent, struct tms *buf)
    7.60 -{
    7.61 -  return (clock_t) -1;
    7.62 -}
    7.63 -
    7.64 -pid_t _wait_r(struct _reent *reent, int *wstatus)
    7.65 -{
    7.66 -  return (pid_t) -1;
    7.67 -}