Ignore:
Timestamp:
Jul 10, 2020, 9:09:25 PM (4 years ago)
Author:
coas-nagasima
Message:

NTShellタスクを更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/ntshell/src/shellif.h

    r439 r441  
    5050 *  @(#) $Id$
    5151 */
    52 #ifndef SHELLIF_H
    53 #define SHELLIF_H
     52#ifndef _SHELLIF_H_
     53#define _SHELLIF_H_
    5454
    5555#ifdef _MSC_VER
    56 #include <time.h>
     56#undef NULL
    5757#endif
    5858
     
    9292#include "../musl-1.1.18/include/bits/stat.h"
    9393#include "../musl-1.1.18/include/sys/select.h"
    94 #ifndef _MSC_VER
    9594#include "../musl-1.1.18/include/time.h"
    96 #endif
    9795#include "../musl-1.1.18/include/signal.h"
    9896#include "../musl-1.1.18/include/stdio.h"
     
    107105#include <stdarg.h>
    108106
     107#define DebugBreak()    asm("bkpt #0")
     108
     109#ifdef __cplusplus
     110extern "C" {
     111#endif
     112
    109113// time.h
    110114#define CLOCK_REALTIME 0
     115int shell_nanosleep(const struct timespec *req, struct timespec *rem);
    111116
    112117// dirent.h
     
    154159// signal.h
    155160int shell_sigprocmask(int how, const sigset_t *restrict set, sigset_t *restrict old);
    156 int shell_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old);
     161struct k_sigaction;
     162int shell_sigaction(int sig, const struct k_sigaction *restrict sa,
     163        struct k_sigaction *restrict old, size_t size);
    157164// socket.h
    158165int shell_socket(int, int, int);
    159166int shell_connect(int, const struct sockaddr *, socklen_t);
    160 ssize_t shell_send(int, const void *, size_t, int);
    161167ssize_t shell_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
    162168ssize_t shell_sendmsg(int, const struct msghdr *, int);
    163169int shell_bind(int, const struct sockaddr *, socklen_t);
    164170int shell_listen(int, int);
    165 int shell_accept(int, struct sockaddr *__restrict, socklen_t *__restrict);
    166 ssize_t shell_recv(int, void *, size_t, int);
    167 ssize_t shell_recvfrom(int, void *__restrict, size_t, int, struct sockaddr *__restrict, socklen_t *__restrict);
     171int shell_accept(int, struct sockaddr *restrict, socklen_t *restrict);
     172ssize_t shell_recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict, socklen_t *restrict);
    168173ssize_t shell_recvmsg(int, struct msghdr *, int);
    169 int shell_getsockopt(int, int, int, void *__restrict, socklen_t *__restrict);
     174int shell_getsockopt(int, int, int, void *restrict, socklen_t *restrict);
    170175int shell_setsockopt(int, int, int, const void *, socklen_t);
    171176int shell_shutdown(int, int);
     177int shell_getpeername(int fd, struct sockaddr *restrict addr, socklen_t *restrict len);
     178int shell_getsockname(int fd, struct sockaddr *restrict addr, socklen_t *restrict len);
    172179// select.h
    173 int shell_select(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
     180int shell_select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timeval *restrict);
    174181// syslog.h
    175182void vsyslog (int, const char *, va_list);
    176183// termios.h
    177 int sio_tcgetattr (int, struct termios *);
    178 int sio_tcsetattr(int, int, const struct termios *);
     184int tcgetattr (int, struct termios *);
     185int tcsetattr(int, int, const struct termios *);
    179186// fcntl.h
    180187int shell_open(const char *, int, void *arg);
     
    196203int shell_chmod(const char *, mode_t);
    197204int shell_mkdir(const char *, mode_t);
    198 int shell_stat(const char *__restrict, struct stat *__restrict);
     205int shell_stat(const char *restrict, struct stat *restrict);
    199206int shell_fstat(int, struct stat *);
    200 int shell_lstat(const char *__restrict, struct stat *__restrict);
     207int shell_lstat(const char *restrict, struct stat *restrict);
    201208
    202209int shell_clock_getres(clockid_t clk_id, struct timespec *res);
     
    215222int shell_mprotect(void *addr, size_t len, int prot);
    216223// TODO
     224int shell_clone(int, int);
     225int shell_dup2(int, int);
     226int shell_execve(const char *, char *const [], char *const []);
     227int shell_faccessat(int, const char *, int, int);
     228int shell_fchmodat(int, const char *, mode_t, int);
     229int shell_flock(int, int);
     230int shell_fork();
     231int shell_futex(volatile int *, int, int, void *);
     232int shell_futimesat(int, const char *, struct timeval *);
     233int shell_getegid();
     234int shell_geteuid();
     235int shell_getgid();
     236int shell_gettid();
     237int shell_getuid();
    217238int shell_madvise(void *, size_t, int);
     239int shell_mremap(void *, size_t, size_t, int, void *);
     240int shell_munmap(void *, size_t);
     241int shell_pipe(int [2]);
     242int shell_pipe2(int [2], int);
     243int shell_ppoll(struct pollfd *, nfds_t, const struct timespec *,const sigset_t *);
     244int shell_pselect6(int, fd_set *restrict, fd_set *restrict,
     245        fd_set *restrict, const struct timespec *restrict, const sigset_t *restrict);
     246int shell_setpgid(pid_t, pid_t);
     247int shell_setsid();
     248int shell_symlink(const char *, const char *);
     249int shell_tkill(int, int);
     250int shell_umask(mode_t);
    218251int shell_uname(struct utsname *);
     252int shell_utimensat(int, const char *, const struct timespec [2], int);
     253int shell_utimes(const char *, struct timeval *);
     254// sys/resource.h
     255struct rusage;
     256int shell_wait4(pid_t, int *, int, struct rusage *);
     257ssize_t shell_getrandom(void *buf, size_t buflen, unsigned int flags);
    219258// ↑↑↑musl
    220259
     
    239278void __mbedcall_cp_asm();
    240279
     280#include "ff.h"
     281WCHAR Utf8_to_Utf16(const char *, int *); /* in ff.c */
     282void Utf16_to_Utf8(unsigned char *, int *, UINT); /* in ff.c */
     283
    241284#ifdef __cplusplus
    242285extern "C" {
    243286#endif
    244 void Kernel_StartExternal(int argc, char **argv);
     287int Kernel_StartExternal(int argc, char **argv);
    245288#ifdef __cplusplus
    246289}
    247290#endif
    248291
    249 #endif /* SHELLIF_H */
     292void *malloc(size_t size);
     293void *calloc(size_t size, size_t count);
     294void *realloc(void *ptr, size_t size);
     295void free(void *ptr);
     296
     297#ifdef __cplusplus
     298}
     299#endif
     300
     301#endif /* _SHELLIF_H_ */
Note: See TracChangeset for help on using the changeset viewer.