diff --git a/src/aio/aio.c b/src/aio/aio.c old mode 100644 new mode 100755 index 6d34fa869340810fc9abddfd5b8412df324aece7..5bb5733b52152285264192151e6c009732831019 --- a/src/aio/aio.c +++ b/src/aio/aio.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "syscall.h" #include "atomic.h" #include "pthread_impl.h" @@ -319,16 +320,19 @@ static int submit(struct aiocb *cb, int op) int aio_read(struct aiocb *cb) { + unsupported_api(__FUNCTION__); return submit(cb, LIO_READ); } int aio_write(struct aiocb *cb) { + unsupported_api(__FUNCTION__); return submit(cb, LIO_WRITE); } int aio_fsync(int op, struct aiocb *cb) { + unsupported_api(__FUNCTION__); if (op != O_SYNC && op != O_DSYNC) { errno = EINVAL; return -1; @@ -338,11 +342,13 @@ int aio_fsync(int op, struct aiocb *cb) ssize_t aio_return(struct aiocb *cb) { + unsupported_api(__FUNCTION__); return cb->__ret; } int aio_error(const struct aiocb *cb) { + unsupported_api(__FUNCTION__); a_barrier(); return cb->__err & 0x7fffffff; } @@ -354,6 +360,7 @@ int aio_cancel(int fd, struct aiocb *cb) struct aio_thread *p; struct aio_queue *q; + unsupported_api(__FUNCTION__); /* Unspecified behavior case. Report an error. */ if (cb && fd != cb->aio_fildes) { errno = EINVAL; diff --git a/src/aio/aio_suspend.c b/src/aio/aio_suspend.c old mode 100644 new mode 100755 index 34b66f8787a49fb97c264b962285a413c34b50dc..3fc0301fddb7f55f992d7e5be386b5f37fe81b9e --- a/src/aio/aio_suspend.c +++ b/src/aio/aio_suspend.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "atomic.h" #include "pthread_impl.h" @@ -12,6 +13,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec int nzcnt = 0; const struct aiocb *cb = 0; + unsupported_api(__FUNCTION__); pthread_testcancel(); if (cnt<0) { diff --git a/src/conf/confstr.c b/src/conf/confstr.c old mode 100644 new mode 100755 index 02cb1aa252dbb4c3362e17f9ed39f5d71c960989..3fa863c73d711efe4d9f59c4f7837d941f818688 --- a/src/conf/confstr.c +++ b/src/conf/confstr.c @@ -1,10 +1,13 @@ #include #include #include +#include size_t confstr(int name, char *buf, size_t len) { const char *s = ""; + + unsupported_api(__FUNCTION__); if (!name) { s = "/bin:/usr/bin"; } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) { diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c old mode 100644 new mode 100755 index e6aca5cffe6f7ff35c0a192974a343f3fb64aa28..f67e8d56e12bd32abff4c0e23e4e525deeec2130 --- a/src/conf/fpathconf.c +++ b/src/conf/fpathconf.c @@ -1,6 +1,7 @@ #include #include #include +#include long fpathconf(int fd, int name) { @@ -27,6 +28,7 @@ long fpathconf(int fd, int name) [_PC_SYMLINK_MAX] = -1, [_PC_2_SYMLINKS] = 1 }; + unsupported_api(__FUNCTION__); if (name >= sizeof(values)/sizeof(values[0])) { errno = EINVAL; return -1; diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c old mode 100644 new mode 100755 index 3baaed3226c80d0fd95ab179626019beccdaaa08..994e38e26fc2e49b02b7605537b686c4929af2b3 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "syscall.h" #include "libc.h" @@ -166,7 +167,7 @@ long sysconf(int name) [_SC_THREAD_ROBUST_PRIO_INHERIT] = -1, [_SC_THREAD_ROBUST_PRIO_PROTECT] = -1, }; - + unsupported_api(__FUNCTION__); if (name >= sizeof(values)/sizeof(values[0]) || !values[name]) { errno = EINVAL; return -1; diff --git a/src/crypt/encrypt.c b/src/crypt/encrypt.c old mode 100644 new mode 100755 index 216abc919b329a35b7ca28847076e83d1a6b40f6..5a3f6503a9dcf9eccb8b359e63229f7ad57e9b6b --- a/src/crypt/encrypt.c +++ b/src/crypt/encrypt.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "crypt_des.h" @@ -11,6 +12,7 @@ void setkey(const char *key) unsigned char bkey[8]; int i, j; + unsupported_api(__FUNCTION__); for (i = 0; i < 8; i++) { bkey[i] = 0; for (j = 7; j >= 0; j--, key++) @@ -27,6 +29,7 @@ void encrypt(char *block, int edflag) int i, j; char *p; + unsupported_api(__FUNCTION__); p = block; for (i = 0; i < 2; i++) { b[i] = 0; diff --git a/src/ctype/wcswidth.c b/src/ctype/wcswidth.c old mode 100644 new mode 100755 index 5c8a5a4dadc2bc7fb41dbdd68d8fb5debdabae6b..ed0f9f204563ce9b3e08fda7d3aa8fde146abf89 --- a/src/ctype/wcswidth.c +++ b/src/ctype/wcswidth.c @@ -1,8 +1,10 @@ #include +#include int wcswidth(const wchar_t *wcs, size_t n) { int l=0, k=0; + unsupported_api(__FUNCTION__); for (; n-- && *wcs && (k = wcwidth(*wcs)) >= 0; l+=k, wcs++); return (k < 0) ? k : l; } diff --git a/src/ctype/wcwidth.c b/src/ctype/wcwidth.c old mode 100644 new mode 100755 index 36256a538551bca3b2c2e7d751f5f05dced856f9..6b86b276101d7e85444f5bc1fca8c77df6438879 --- a/src/ctype/wcwidth.c +++ b/src/ctype/wcwidth.c @@ -1,4 +1,5 @@ #include +#include static const unsigned char table[] = { #include "nonspacing.h" @@ -10,6 +11,7 @@ static const unsigned char wtable[] = { int wcwidth(wchar_t wc) { + unsupported_api(__FUNCTION__); if (wc < 0xffU) return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0; if ((wc & 0xfffeffffU) < 0xfffe) { diff --git a/src/dirent/dirfd.c b/src/dirent/dirfd.c old mode 100644 new mode 100755 index 6c860073990343b83646e7c1c544eae5a699cecc..876d00c311d7c175967012c9fab21c6086e4e7f6 --- a/src/dirent/dirfd.c +++ b/src/dirent/dirfd.c @@ -1,7 +1,9 @@ #include #include "__dirent.h" +#include int dirfd(DIR *d) { + unsupported_api(__FUNCTION__); return d->fd; } diff --git a/src/dirent/fdopendir.c b/src/dirent/fdopendir.c old mode 100644 new mode 100755 index d78fb87f9bc909dcbf4a81a779a76dcb89696b17..d5bbfd2cca8ceab4e8382663e59ab7f4e29f8bba --- a/src/dirent/fdopendir.c +++ b/src/dirent/fdopendir.c @@ -4,12 +4,15 @@ #include #include #include "__dirent.h" +#include DIR *fdopendir(int fd) { DIR *dir; struct stat st; + unsupported_api(__FUNCTION__); + if (fstat(fd, &st) < 0) { return 0; } diff --git a/src/env/unsetenv.c b/src/env/unsetenv.c old mode 100644 new mode 100755 index b14c4c929b1f18033e68a480d4500856f33bdaa5..07b824d1ec61ece143ab558520b8a5ace287446f --- a/src/env/unsetenv.c +++ b/src/env/unsetenv.c @@ -2,12 +2,14 @@ #include #include #include +#include static void dummy(char *old, char *new) {} weak_alias(dummy, __env_rm_add); int unsetenv(const char *name) { + unsupported_api(__FUNCTION__); size_t l = __strchrnul(name, '=') - name; if (!l || name[l]) { errno = EINVAL; diff --git a/src/fcntl/openat.c b/src/fcntl/openat.c old mode 100644 new mode 100755 index ad165ec323f77ac3c91b91573f46a3a5802af6c3..7982a80d776521654eea81f2d66c44b2ed711d70 --- a/src/fcntl/openat.c +++ b/src/fcntl/openat.c @@ -1,11 +1,13 @@ #include #include #include "syscall.h" +#include int openat(int fd, const char *filename, int flags, ...) { mode_t mode = 0; + unsupported_api(__FUNCTION__); if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) { va_list ap; va_start(ap, flags); diff --git a/src/fcntl/posix_fadvise.c b/src/fcntl/posix_fadvise.c old mode 100644 new mode 100755 index 75b8e1aed87f7e1799f755140c79014d1b06027d..641dc56f7046a50593eca8e077cd926f8bc2f481 --- a/src/fcntl/posix_fadvise.c +++ b/src/fcntl/posix_fadvise.c @@ -1,8 +1,11 @@ #include +#include + #include "syscall.h" int posix_fadvise(int fd, off_t base, off_t len, int advice) { + unsupported_api(__FUNCTION__); #if defined(SYSCALL_FADVISE_6_ARG) /* Some archs, at least arm and powerpc, have the syscall * arguments reordered to avoid needing 7 argument registers diff --git a/src/internal/unsupported_api.h b/src/internal/unsupported_api.h new file mode 100755 index 0000000000000000000000000000000000000000..aa48b46f84697609e113516c415817419ef510fc --- /dev/null +++ b/src/internal/unsupported_api.h @@ -0,0 +1,11 @@ +#ifndef UNSUPPORTED_API_H +#define UNSUPPORTED_API_H + +#include + +static inline void unsupported_api(const char *func) +{ + fprintf(stderr, "[ERR]Unsupported API %s\n", func); +} + +#endif diff --git a/src/ipc/ftok.c b/src/ipc/ftok.c old mode 100644 new mode 100755 index c36b4b6003af532305ac2b461616d219f11f31b2..5733836bd5da874e938eefa045811cb564ae426a --- a/src/ipc/ftok.c +++ b/src/ipc/ftok.c @@ -1,9 +1,11 @@ #include #include +#include key_t ftok(const char *path, int id) { struct stat st; + unsupported_api(__FUNCTION__); if (stat(path, &st) < 0) return -1; return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xffu) << 24)); diff --git a/src/ipc/msgctl.c b/src/ipc/msgctl.c old mode 100644 new mode 100755 index b043041a565a1c21bab03b616afb79c4e2a84e0d..48a2a0a17403d4c1a1c51e5ab5d99cce7082c934 --- a/src/ipc/msgctl.c +++ b/src/ipc/msgctl.c @@ -1,5 +1,7 @@ #include #include +#include + #include "syscall.h" #include "ipc.h" @@ -9,6 +11,7 @@ int msgctl(int q, int cmd, struct msqid_ds *buf) { + unsupported_api(__FUNCTION__); #ifdef SYSCALL_IPC_BROKEN_MODE struct msqid_ds tmp; if (cmd == IPC_SET) { diff --git a/src/ipc/msgget.c b/src/ipc/msgget.c old mode 100644 new mode 100755 index 30a4b42b854c2f257de28587db2e7b9efd805131..9ff7a053b6f329d789eac73a39083e20a9ce52d8 --- a/src/ipc/msgget.c +++ b/src/ipc/msgget.c @@ -1,9 +1,12 @@ #include +#include + #include "syscall.h" #include "ipc.h" int msgget(key_t k, int flag) { + unsupported_api(__FUNCTION__); #ifndef SYS_ipc return syscall(SYS_msgget, k, flag); #else diff --git a/src/ipc/msgrcv.c b/src/ipc/msgrcv.c old mode 100644 new mode 100755 index 9d1034b145012cd76e2613d5d7e7f55ab0c3787a..c66eb52fac3c967efdfd1aa608214f39dafb89f3 --- a/src/ipc/msgrcv.c +++ b/src/ipc/msgrcv.c @@ -1,9 +1,12 @@ #include +#include + #include "syscall.h" #include "ipc.h" ssize_t msgrcv(int q, void *m, size_t len, long type, int flag) { + unsupported_api(__FUNCTION__); #ifndef SYS_ipc return syscall_cp(SYS_msgrcv, q, m, len, type, flag); #else diff --git a/src/ipc/msgsnd.c b/src/ipc/msgsnd.c old mode 100644 new mode 100755 index 99bb17e94acab0e1c9afd07f452d1ca88b4dff16..4db4d4ef4876e923ffd3162d4be013b01e0ada97 --- a/src/ipc/msgsnd.c +++ b/src/ipc/msgsnd.c @@ -1,9 +1,11 @@ +#include #include #include "syscall.h" #include "ipc.h" int msgsnd(int q, const void *m, size_t len, int flag) { + unsupported_api(__FUNCTION__); #ifndef SYS_ipc return syscall_cp(SYS_msgsnd, q, m, len, flag); #else diff --git a/src/ipc/semctl.c b/src/ipc/semctl.c old mode 100644 new mode 100755 index ed9827477aee81c032a0c7d29c9c8595ca64eed8..9e9f15e3b3a3f759e21d4fd702ae520c13dea1bf --- a/src/ipc/semctl.c +++ b/src/ipc/semctl.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include "syscall.h" #include "ipc.h" @@ -16,6 +18,7 @@ union semun { int semctl(int id, int num, int cmd, ...) { + unsupported_api(__FUNCTION__); union semun arg = {0}; va_list ap; switch (cmd & ~IPC_TIME64) { diff --git a/src/ipc/semget.c b/src/ipc/semget.c old mode 100644 new mode 100755 index 2cdf626b500239d8a7427b23f284698aeea6cbea..858d5bd611013d9845131cce7baa4f53f47bc0bb --- a/src/ipc/semget.c +++ b/src/ipc/semget.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include "syscall.h" #include "ipc.h" @@ -10,6 +12,7 @@ int semget(key_t key, int n, int fl) * of struct semid_ds, and thus might not check that the * n fits in the correct (per POSIX) userspace type, so * we have to check here. */ + unsupported_api(__FUNCTION__); if (n > USHRT_MAX) return __syscall_ret(-EINVAL); #ifndef SYS_ipc return syscall(SYS_semget, key, n, fl); diff --git a/src/ipc/semop.c b/src/ipc/semop.c old mode 100644 new mode 100755 index 5f0c7deaf308a38723726139bebc4ad03f3576dd..1c96614fb256238ae6deb3cec9879ac5256bd39d --- a/src/ipc/semop.c +++ b/src/ipc/semop.c @@ -1,9 +1,12 @@ #include +#include + #include "syscall.h" #include "ipc.h" int semop(int id, struct sembuf *buf, size_t n) { + unsupported_api(__FUNCTION__); #ifndef SYS_ipc return syscall(SYS_semop, id, buf, n); #else diff --git a/src/legacy/daemon.c b/src/legacy/daemon.c old mode 100644 new mode 100755 index 1568b1dcb7517bf0cf1ccb0b094b2dde2f88c59c..57838e78157f40f2fbdf12b454182f383e0e9d79 --- a/src/legacy/daemon.c +++ b/src/legacy/daemon.c @@ -1,9 +1,11 @@ #define _GNU_SOURCE #include #include +#include int daemon(int nochdir, int noclose) { + unsupported_api(__FUNCTION__); if (!nochdir && chdir("/")) return -1; if (!noclose) { diff --git a/src/legacy/getdtablesize.c b/src/legacy/getdtablesize.c old mode 100644 new mode 100755 index b30c1933a272d13b3d7918afd053dcd328d700c2..672e0556c4cbe7509fef5b60f3f34e9f9d04e1a6 --- a/src/legacy/getdtablesize.c +++ b/src/legacy/getdtablesize.c @@ -2,10 +2,12 @@ #include #include #include +#include int getdtablesize(void) { struct rlimit rl; + unsupported_api(__FUNCTION__); getrlimit(RLIMIT_NOFILE, &rl); return rl.rlim_cur < INT_MAX ? rl.rlim_cur : INT_MAX; } diff --git a/src/legacy/getusershell.c b/src/legacy/getusershell.c old mode 100644 new mode 100755 index 5fecdec2e44196f19a53dc4fd15018abc47bbb8c..c17ada7734d2acba36143995d337fecda302aea4 --- a/src/legacy/getusershell.c +++ b/src/legacy/getusershell.c @@ -1,6 +1,7 @@ #define _GNU_SOURCE #include #include +#include static const char defshells[] = "/bin/sh\n/bin/csh\n"; @@ -10,6 +11,7 @@ static FILE *f; void endusershell(void) { + unsupported_api(__FUNCTION__); if (f) fclose(f); f = 0; } diff --git a/src/legacy/isastream.c b/src/legacy/isastream.c old mode 100644 new mode 100755 index 4dafdb08210f5617d2ce116e1530e603b7490caf..9398088e559ed0eda97a780eb764c19376b70a65 --- a/src/legacy/isastream.c +++ b/src/legacy/isastream.c @@ -1,7 +1,8 @@ #include #include - +#include int isastream(int fd) { + unsupported_api(__FUNCTION__); return fcntl(fd, F_GETFD) < 0 ? -1 : 0; } diff --git a/src/legacy/ulimit.c b/src/legacy/ulimit.c old mode 100644 new mode 100755 index 1f59e8e619f5588fdd0a1cf3bd394729b3d0192c..5580bf88511c921e85599f72e1ad25116a803a80 --- a/src/legacy/ulimit.c +++ b/src/legacy/ulimit.c @@ -1,10 +1,12 @@ #include #include #include +#include long ulimit(int cmd, ...) { struct rlimit rl; + unsupported_api(__FUNCTION__); getrlimit(RLIMIT_FSIZE, &rl); if (cmd == UL_SETFSIZE) { long val; diff --git a/src/legacy/utmpx.c b/src/legacy/utmpx.c old mode 100644 new mode 100755 index 7aa65da335b5efe45fe8a3416318792e6c5dae0c..a9f05a2a41fd10b0b4ba508d6d652f8db72fb80f --- a/src/legacy/utmpx.c +++ b/src/legacy/utmpx.c @@ -2,41 +2,50 @@ #include #include #include +#include void endutxent(void) { + unsupported_api(__FUNCTION__); } void setutxent(void) { + unsupported_api(__FUNCTION__); } struct utmpx *getutxent(void) { + unsupported_api(__FUNCTION__); return NULL; } struct utmpx *getutxid(const struct utmpx *ut) { + unsupported_api(__FUNCTION__); return NULL; } struct utmpx *getutxline(const struct utmpx *ut) { + unsupported_api(__FUNCTION__); return NULL; } struct utmpx *pututxline(const struct utmpx *ut) { + unsupported_api(__FUNCTION__); return NULL; } void updwtmpx(const char *f, const struct utmpx *u) { + unsupported_api(__FUNCTION__); } static int __utmpxname(const char *f) { + unsupported_api(__FUNCTION__); errno = ENOTSUP; return -1; } diff --git a/src/linux/adjtime.c b/src/linux/adjtime.c old mode 100644 new mode 100755 index 5a707f2f217e829127247301896883667f487b5a..871623a961c117d90eb50f395dac76a396e0bde1 --- a/src/linux/adjtime.c +++ b/src/linux/adjtime.c @@ -3,10 +3,12 @@ #include #include #include "syscall.h" +#include int adjtime(const struct timeval *in, struct timeval *out) { struct timex tx = { 0 }; + unsupported_api(__FUNCTION__); if (in) { if (in->tv_sec > 1000 || in->tv_usec > 1000000000) { errno = EINVAL; diff --git a/src/linux/clone.c b/src/linux/clone.c old mode 100644 new mode 100755 index 8c1af7d3dc83e76a10cf7393aa6cbb5dc26111cf..0db0250ae4178704838a029c292fa1f53249f160 --- a/src/linux/clone.c +++ b/src/linux/clone.c @@ -4,6 +4,7 @@ #include #include "pthread_impl.h" #include "syscall.h" +#include int clone(int (*func)(void *), void *stack, int flags, void *arg, ...) { @@ -11,6 +12,7 @@ int clone(int (*func)(void *), void *stack, int flags, void *arg, ...) pid_t *ptid, *ctid; void *tls; + unsupported_api(__FUNCTION__); va_start(ap, arg); ptid = va_arg(ap, pid_t *); tls = va_arg(ap, void *); diff --git a/src/linux/epoll.c b/src/linux/epoll.c old mode 100644 new mode 100755 index deff5b101aade0dde5efff1cad5272b3e782ef83..3fc76b9086efe413c729b8191e4d520c395a0968 --- a/src/linux/epoll.c +++ b/src/linux/epoll.c @@ -2,9 +2,11 @@ #include #include #include "syscall.h" +#include int epoll_create(int size) { + unsupported_api(__FUNCTION__); return epoll_create1(0); } @@ -19,6 +21,7 @@ int epoll_create1(int flags) int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) { + unsupported_api(__FUNCTION__); return syscall(SYS_epoll_ctl, fd, op, fd2, ev); } @@ -33,5 +36,6 @@ int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to) { + unsupported_api(__FUNCTION__); return epoll_pwait(fd, ev, cnt, to, 0); } diff --git a/src/linux/ppoll.c b/src/linux/ppoll.c old mode 100644 new mode 100755 index e614600ab8b721e6b41dc96d589d3365337fbb9a..060cad70b11e78133db367574245510e5c901c59 --- a/src/linux/ppoll.c +++ b/src/linux/ppoll.c @@ -3,6 +3,7 @@ #include #include #include "syscall.h" +#include #define IS32BIT(x) !((x)+0x80000000ULL>>32) #define CLAMP(x) (int)(IS32BIT(x) ? (x) : 0x7fffffffU+((0ULL+(x))>>63)) @@ -11,6 +12,7 @@ int ppoll(struct pollfd *fds, nfds_t n, const struct timespec *to, const sigset_ { time_t s = to ? to->tv_sec : 0; long ns = to ? to->tv_nsec : 0; + unsupported_api(__FUNCTION__); #ifdef SYS_ppoll_time64 int r = -ENOSYS; if (SYS_ppoll == SYS_ppoll_time64 || !IS32BIT(s)) diff --git a/src/linux/utimes.c b/src/linux/utimes.c old mode 100644 new mode 100755 index 6ca025d95a3255fccc5d5345683fc33aa62f42e6..b6f6df0640bf85bda6c3f2e04dd9a7eda2959520 --- a/src/linux/utimes.c +++ b/src/linux/utimes.c @@ -1,8 +1,10 @@ #include +#include #include "fcntl.h" #include "syscall.h" int utimes(const char *path, const struct timeval times[2]) { + unsupported_api(__FUNCTION__); return __futimesat(AT_FDCWD, path, times); } diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c old mode 100644 new mode 100755 index 4c30439389805224cb14910f09674b56a2177711..d36634e63dff0873f162c0814117ff10ed3edf31 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "locale_impl.h" #include "atomic.h" #include "pleval.h" @@ -258,15 +259,18 @@ notrans: char *dcgettext(const char *domainname, const char *msgid, int category) { + unsupported_api(__FUNCTION__); return dcngettext(domainname, msgid, 0, 1, category); } char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { + unsupported_api(__FUNCTION__); return dcngettext(domainname, msgid1, msgid2, n, LC_MESSAGES); } char *dgettext(const char *domainname, const char *msgid) { + unsupported_api(__FUNCTION__); return dcngettext(domainname, msgid, 0, 1, LC_MESSAGES); } diff --git a/src/locale/duplocale.c b/src/locale/duplocale.c old mode 100644 new mode 100755 index 030b64cb0e706cdf29c7104526e86b6ee08d7adb..2ed823d194c5ea56dcf55dc2183b6d740b060f01 --- a/src/locale/duplocale.c +++ b/src/locale/duplocale.c @@ -1,11 +1,13 @@ #include #include +#include #include "locale_impl.h" #include "libc.h" locale_t __duplocale(locale_t old) { locale_t new = malloc(sizeof *new); + unsupported_api(__FUNCTION__); if (!new) return 0; if (old == LC_GLOBAL_LOCALE) old = &libc.global_locale; *new = *old; diff --git a/src/locale/freelocale.c b/src/locale/freelocale.c old mode 100644 new mode 100755 index 802b8bfe1c72458d8def7c505df0c022d026b1f0..74ca22b72cda08a2ecfa8b023120c20d3226127e --- a/src/locale/freelocale.c +++ b/src/locale/freelocale.c @@ -1,8 +1,10 @@ #include +#include #include "locale_impl.h" void freelocale(locale_t l) { + unsupported_api(__FUNCTION__); if (__loc_is_allocated(l)) free(l); } diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c old mode 100644 new mode 100755 index 14773093b8b88a1daa138f816cb1aac2bfe5a29a..bdae1d291576fd857721036b7976a6dd12853bca --- a/src/locale/langinfo.c +++ b/src/locale/langinfo.c @@ -1,5 +1,6 @@ #include #include +#include #include "locale_impl.h" static const char c_time[] = @@ -32,12 +33,14 @@ char *__nl_langinfo_l(nl_item item, locale_t loc) int idx = item & 65535; const char *str; + unsupported_api(__FUNCTION__); + if (item == CODESET) return loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII"; /* _NL_LOCALE_NAME extension */ if (idx == 65535 && cat < LC_ALL) return loc->cat[cat] ? (char *)loc->cat[cat]->name : "C"; - + switch (cat) { case LC_NUMERIC: if (idx > 1) return ""; @@ -66,6 +69,7 @@ char *__nl_langinfo_l(nl_item item, locale_t loc) char *__nl_langinfo(nl_item item) { + unsupported_api(__FUNCTION__); return __nl_langinfo_l(item, CURRENT_LOCALE); } diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c old mode 100644 new mode 100755 index d20a8489835f54e26fb4a59ffcb419b5da43f4bf..de1c3fe4b8254b77ce38dd6658d59273f5f0ed0a --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -2,6 +2,7 @@ #include #include #include "locale_impl.h" +#include static pthread_once_t default_locale_once; static struct __locale_struct default_locale, default_ctype_locale; @@ -23,6 +24,7 @@ locale_t __newlocale(int mask, const char *name, locale_t loc) { struct __locale_struct tmp; + unsupported_api(__FUNCTION__); for (int i=0; icat[i] : __get_locale(i, (mask & (1< #include #include +#include #include "locale_impl.h" static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap) @@ -80,6 +81,7 @@ ssize_t strfmon_l(char *restrict s, size_t n, locale_t loc, const char *restrict va_list ap; ssize_t ret; + unsupported_api(__FUNCTION__); va_start(ap, fmt); ret = vstrfmon_l(s, n, loc, fmt, ap); va_end(ap); diff --git a/src/locale/strxfrm.c b/src/locale/strxfrm.c old mode 100644 new mode 100755 index c66c62039d9593ac8b9d0ca732ce8c98e9107555..04283f1d7fc680c5255087ca2265c65ea8d3fd16 --- a/src/locale/strxfrm.c +++ b/src/locale/strxfrm.c @@ -1,10 +1,12 @@ #include #include +#include #include "locale_impl.h" /* collate only by code points */ size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc) { + unsupported_api(__FUNCTION__); size_t l = strlen(src); if (n > l) strcpy(dest, src); return l; diff --git a/src/locale/textdomain.c b/src/locale/textdomain.c old mode 100644 new mode 100755 index d727539799fd8c0394e7e0c859dbbd7b38d0961a..27f3a3ff667bf5b9cb32febee110ac66a3ba5acc --- a/src/locale/textdomain.c +++ b/src/locale/textdomain.c @@ -3,6 +3,7 @@ #include #include #include +#include static char *current_domain; @@ -13,6 +14,7 @@ char *__gettextdomain() char *textdomain(const char *domainname) { + unsupported_api(__FUNCTION__); if (!domainname) return __gettextdomain(); size_t domlen = strlen(domainname); @@ -33,10 +35,12 @@ char *textdomain(const char *domainname) char *gettext(const char *msgid) { + unsupported_api(__FUNCTION__); return dgettext(0, msgid); } char *ngettext(const char *msgid1, const char *msgid2, unsigned long int n) { + unsupported_api(__FUNCTION__); return dngettext(0, msgid1, msgid2, n); } diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c old mode 100644 new mode 100755 index 0fc5ecbc07f29437e1afb66815074360bfd360cb..360b9dd57f51953bde2d3341236c9b49b8ca42eb --- a/src/locale/uselocale.c +++ b/src/locale/uselocale.c @@ -1,9 +1,11 @@ +#include #include "locale_impl.h" #include "pthread_impl.h" #include "libc.h" locale_t __uselocale(locale_t new) { + unsupported_api(__FUNCTION__); pthread_t self = __pthread_self(); locale_t old = self->locale; locale_t global = &libc.global_locale; diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c old mode 100644 new mode 100755 index 25bb35db862d297f92ff3931b1964373d48194d8..f6c223da77e8f5c7a6034c0b02d6a39b3c33adb7 --- a/src/misc/gethostid.c +++ b/src/misc/gethostid.c @@ -1,6 +1,8 @@ #include +#include long gethostid() { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/misc/getrlimit.c b/src/misc/getrlimit.c old mode 100644 new mode 100755 index 2ab2f0f4faadddb5c45942bad18d7ef079ed4afb..69b73fcc10ab3f8ed88c95cfe7930a2435203688 --- a/src/misc/getrlimit.c +++ b/src/misc/getrlimit.c @@ -1,5 +1,6 @@ #include #include +#include #include "syscall.h" #define FIX(x) do{ if ((x)>=SYSCALL_RLIM_INFINITY) (x)=RLIM_INFINITY; }while(0) @@ -7,6 +8,7 @@ int getrlimit(int resource, struct rlimit *rlim) { unsigned long k_rlim[2]; + unsupported_api(__FUNCTION__); int ret = syscall(SYS_prlimit64, 0, resource, 0, rlim); if (!ret) { FIX(rlim->rlim_cur); diff --git a/src/misc/getrusage.c b/src/misc/getrusage.c old mode 100644 new mode 100755 index 8e03e2e3db4e3bbb746a64e4ad32d321d08cd33a..ea491ef78d42117b157eaf0f583bcd6ddcb56ee9 --- a/src/misc/getrusage.c +++ b/src/misc/getrusage.c @@ -1,11 +1,13 @@ #include #include #include +#include #include "syscall.h" int getrusage(int who, struct rusage *ru) { int r; + unsupported_api(__FUNCTION__); #ifdef SYS_getrusage_time64 long long kru64[18]; r = __syscall(SYS_getrusage_time64, who, kru64); diff --git a/src/misc/lockf.c b/src/misc/lockf.c old mode 100644 new mode 100755 index 16a80bec13206fe99ec5d0000f838a2fbb0b007d..f6d9a0bbd69c89832d8cfffec3f8514a974a5ecd --- a/src/misc/lockf.c +++ b/src/misc/lockf.c @@ -1,6 +1,7 @@ #include #include #include +#include int lockf(int fd, int op, off_t size) { @@ -9,6 +10,7 @@ int lockf(int fd, int op, off_t size) .l_whence = SEEK_CUR, .l_len = size, }; + unsupported_api(__FUNCTION__); switch (op) { case F_TEST: l.l_type = F_RDLCK; diff --git a/src/misc/mntent.c b/src/misc/mntent.c old mode 100644 new mode 100755 index eabb8200bf94d2b450971ff54d3951d365b939f9..2ddaaeed3707b0e3e8068e617540b49ddab2de2a --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -2,6 +2,7 @@ #include #include #include +#include static char *internal_buf; static size_t internal_bufsize; @@ -10,6 +11,7 @@ static size_t internal_bufsize; FILE *setmntent(const char *name, const char *mode) { + unsupported_api(__FUNCTION__); return fopen(name, mode); } @@ -26,6 +28,7 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle mnt->mnt_freq = 0; mnt->mnt_passno = 0; + unsupported_api(__FUNCTION__); do { if (use_internal) { getline(&internal_buf, &internal_bufsize, f); @@ -60,11 +63,13 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle struct mntent *getmntent(FILE *f) { static struct mntent mnt; + unsupported_api(__FUNCTION__); return getmntent_r(f, &mnt, SENTINEL, 0); } int addmntent(FILE *f, const struct mntent *mnt) { + unsupported_api(__FUNCTION__); if (fseek(f, 0, SEEK_END)) return 1; return fprintf(f, "%s\t%s\t%s\t%s\t%d\t%d\n", mnt->mnt_fsname, mnt->mnt_dir, mnt->mnt_type, mnt->mnt_opts, @@ -73,5 +78,6 @@ int addmntent(FILE *f, const struct mntent *mnt) char *hasmntopt(const struct mntent *mnt, const char *opt) { + unsupported_api(__FUNCTION__); return strstr(mnt->mnt_opts, opt); } diff --git a/src/misc/openpty.c b/src/misc/openpty.c old mode 100644 new mode 100755 index c10740606111778c16b1d6c3dd3adb5a791240b6..9c1ed03699c1be91b1a74efe8960b7b1937bf094 --- a/src/misc/openpty.c +++ b/src/misc/openpty.c @@ -4,6 +4,7 @@ #include #include #include +#include /* Nonstandard, but vastly superior to the standard functions */ @@ -12,6 +13,7 @@ int openpty(int *pm, int *ps, char *name, const struct termios *tio, const struc int m, s, n=0, cs; char buf[20]; + unsupported_api(__FUNCTION__); m = open("/dev/ptmx", O_RDWR|O_NOCTTY); if (m < 0) return -1; diff --git a/src/misc/pty.c b/src/misc/pty.c old mode 100644 new mode 100755 index a0577147a4c2b6ef251ede679d56354b406fbb4c..8842b0e51ac0471bbaf218008aa08a18aa950209 --- a/src/misc/pty.c +++ b/src/misc/pty.c @@ -3,10 +3,12 @@ #include #include #include +#include #include "syscall.h" int posix_openpt(int flags) { + unsupported_api(__FUNCTION__); int r = open("/dev/ptmx", flags); if (r < 0 && errno == ENOSPC) errno = EAGAIN; return r; @@ -14,6 +16,7 @@ int posix_openpt(int flags) int grantpt(int fd) { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/misc/setrlimit.c b/src/misc/setrlimit.c old mode 100644 new mode 100755 index 7a66ab29756b4a179a8077d7b4f50598b639e9da..715667551024b76812597c1a8e5fda17268213c7 --- a/src/misc/setrlimit.c +++ b/src/misc/setrlimit.c @@ -1,5 +1,6 @@ #include #include +#include #include "syscall.h" #include "libc.h" @@ -38,6 +39,7 @@ static void do_setrlimit(void *p) int setrlimit(int resource, const struct rlimit *rlim) { + unsupported_api(__FUNCTION__); struct ctx c = { .res = resource, .rlim = rlim, .err = -1 }; __synccall(do_setrlimit, &c); if (c.err) { diff --git a/src/misc/syslog.c b/src/misc/syslog.c old mode 100644 new mode 100755 index 13d4b0a6d7bc34f737eb9bb36d09bf0881f6b557..1c5dcbc43ebfb4c7d68b693d6d50534f85c853a0 --- a/src/misc/syslog.c +++ b/src/misc/syslog.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "lock.h" static volatile int lock[1]; @@ -20,6 +21,7 @@ static int log_fd = -1; int setlogmask(int maskpri) { + unsupported_api(__FUNCTION__); LOCK(lock); int ret = log_mask; if (maskpri) log_mask = maskpri; @@ -38,6 +40,7 @@ static const struct { void closelog(void) { int cs; + unsupported_api(__FUNCTION__); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); LOCK(lock); close(log_fd); @@ -55,6 +58,7 @@ static void __openlog() void openlog(const char *ident, int opt, int facility) { int cs; + unsupported_api(__FUNCTION__); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); LOCK(lock); @@ -135,6 +139,7 @@ static void __vsyslog(int priority, const char *message, va_list ap) void syslog(int priority, const char *message, ...) { + unsupported_api(__FUNCTION__); va_list ap; va_start(ap, message); __vsyslog(priority, message, ap); diff --git a/src/misc/wordexp.c b/src/misc/wordexp.c old mode 100644 new mode 100755 index db83a69f37d996aa2a9f61bde18a60c06a727505..19d4fe1fdeb35901cfb4ffb0fabc1f1654c7aa57 --- a/src/misc/wordexp.c +++ b/src/misc/wordexp.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "pthread_impl.h" static void reap(pid_t pid) @@ -170,6 +171,7 @@ nospace: int wordexp(const char *restrict s, wordexp_t *restrict we, int flags) { int r, cs; + unsupported_api(__FUNCTION__); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); r = do_wordexp(s, we, flags); pthread_setcancelstate(cs, 0); diff --git a/src/mman/mlock.c b/src/mman/mlock.c old mode 100644 new mode 100755 index 71af582fe6a3eb1538a59a1dded009d16ab062b8..e56c3228ee2042d88331dbb2f898f8cace15eca2 --- a/src/mman/mlock.c +++ b/src/mman/mlock.c @@ -1,8 +1,10 @@ #include #include "syscall.h" +#include int mlock(const void *addr, size_t len) { + unsupported_api(__FUNCTION__); #ifdef SYS_mlock return syscall(SYS_mlock, addr, len); #else diff --git a/src/mman/mlockall.c b/src/mman/mlockall.c old mode 100644 new mode 100755 index 0ba4e662c8fa42a0bfb213f0ca411cb40826bf22..bc2411e6554cedd67ba5bdbe6674e2e2813b9fce --- a/src/mman/mlockall.c +++ b/src/mman/mlockall.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int mlockall(int flags) { + unsupported_api(__FUNCTION__); return syscall(SYS_mlockall, flags); } diff --git a/src/mman/msync.c b/src/mman/msync.c old mode 100644 new mode 100755 index fcd8cdf9fc17de3a366f1f512be06f0fdbd79672..61cbf5f0dea219ac6965fbc5bf4efff2f5b894c9 --- a/src/mman/msync.c +++ b/src/mman/msync.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int msync(void *start, size_t len, int flags) { + unsupported_api(__FUNCTION__); return syscall_cp(SYS_msync, start, len, flags); } diff --git a/src/mman/munlock.c b/src/mman/munlock.c old mode 100644 new mode 100755 index 2cccef0c5077f1ec7085ff9bbd2158b4fe297033..8a6463a1e0d679958def81378cb9d996b128a590 --- a/src/mman/munlock.c +++ b/src/mman/munlock.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int munlock(const void *addr, size_t len) { + unsupported_api(__FUNCTION__); return syscall(SYS_munlock, addr, len); } diff --git a/src/mman/munlockall.c b/src/mman/munlockall.c old mode 100644 new mode 100755 index 6e9d39d68480150d43c0e8e9d3c98544798328c5..4327007426044b72f7a5f9905e75cde36b22745d --- a/src/mman/munlockall.c +++ b/src/mman/munlockall.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int munlockall(void) { + unsupported_api(__FUNCTION__); return syscall(SYS_munlockall); } diff --git a/src/mman/posix_madvise.c b/src/mman/posix_madvise.c old mode 100644 new mode 100755 index e5e5acb84aba85765096b00058c3804aa8a2402a..8498ec939642eac2d7d019991fc4c592e61bc026 --- a/src/mman/posix_madvise.c +++ b/src/mman/posix_madvise.c @@ -1,9 +1,11 @@ #define _GNU_SOURCE #include +#include #include "syscall.h" int posix_madvise(void *addr, size_t len, int advice) { + unsupported_api(__FUNCTION__); if (advice == MADV_DONTNEED) return 0; return -__syscall(SYS_madvise, addr, len, advice); } diff --git a/src/mman/shm_open.c b/src/mman/shm_open.c old mode 100644 new mode 100755 index 79784bd306e2dac347cea17af92b2b80c8ea1831..ef8a8c94618654cebf99f2234b9b97cd4d39457a --- a/src/mman/shm_open.c +++ b/src/mman/shm_open.c @@ -5,6 +5,7 @@ #include #include #include +#include char *__shm_mapname(const char *name, char *buf) { @@ -28,6 +29,7 @@ int shm_open(const char *name, int flag, mode_t mode) { int cs; char buf[NAME_MAX+10]; + unsupported_api(__FUNCTION__); if (!(name = __shm_mapname(name, buf))) return -1; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); int fd = open(name, flag|O_NOFOLLOW|O_CLOEXEC|O_NONBLOCK, mode); @@ -38,6 +40,7 @@ int shm_open(const char *name, int flag, mode_t mode) int shm_unlink(const char *name) { char buf[NAME_MAX+10]; + unsupported_api(__FUNCTION__); if (!(name = __shm_mapname(name, buf))) return -1; return unlink(name); } diff --git a/src/network/ent.c b/src/network/ent.c old mode 100644 new mode 100755 index c6e012306dd8b1674f2a54a45e6151833d60356a..e8f840ede5d7b0d6d3c6d9bc2c064d974089bb82 --- a/src/network/ent.c +++ b/src/network/ent.c @@ -1,21 +1,26 @@ #include +#include void sethostent(int x) { + unsupported_api(__FUNCTION__); } struct hostent *gethostent() { + unsupported_api(__FUNCTION__); return 0; } struct netent *getnetent() { + unsupported_api(__FUNCTION__); return 0; } void endhostent(void) { + unsupported_api(__FUNCTION__); } weak_alias(sethostent, setnetent); diff --git a/src/network/ether.c b/src/network/ether.c old mode 100644 new mode 100755 index 4304a972fe5affea6cf5d24a1e802a9043e9fa83..e3d295107dbcd269e870999922431ca8bddc9385 --- a/src/network/ether.c +++ b/src/network/ether.c @@ -1,6 +1,7 @@ #include #include #include +#include struct ether_addr *ether_aton_r (const char *x, struct ether_addr *p_a) { @@ -44,15 +45,18 @@ char *ether_ntoa (const struct ether_addr *p_a) { int ether_line(const char *l, struct ether_addr *e, char *hostname) { + unsupported_api(__FUNCTION__); return -1; } int ether_ntohost(char *hostname, const struct ether_addr *e) { + unsupported_api(__FUNCTION__); return -1; } int ether_hostton(const char *hostname, struct ether_addr *e) { + unsupported_api(__FUNCTION__); return -1; } diff --git a/src/network/freeaddrinfo.c b/src/network/freeaddrinfo.c old mode 100644 new mode 100755 index 62241c239e27f8e09a4a437a104f595f69c16255..e86e3dacb26753c10c32705d1ed897061d3597af --- a/src/network/freeaddrinfo.c +++ b/src/network/freeaddrinfo.c @@ -3,10 +3,12 @@ #include #include "lookup.h" #include "lock.h" +#include void freeaddrinfo(struct addrinfo *p) { size_t cnt; + unsupported_api(__FUNCTION__); for (cnt=1; p->ai_next; cnt++, p=p->ai_next); struct aibuf *b = (void *)((char *)p - offsetof(struct aibuf, ai)); b -= b->slot; diff --git a/src/network/gai_strerror.c b/src/network/gai_strerror.c old mode 100644 new mode 100755 index 9596580e9ffbda7a2e46465ab0f91256db5c51a9..1415e9769b87c0a4a51b3f70384f33a64b6bb7cc --- a/src/network/gai_strerror.c +++ b/src/network/gai_strerror.c @@ -1,4 +1,5 @@ #include +#include #include "locale_impl.h" static const char msgs[] = @@ -19,6 +20,7 @@ static const char msgs[] = const char *gai_strerror(int ecode) { const char *s; + unsupported_api(__FUNCTION__); for (s=msgs, ecode++; ecode && *s; ecode++, s++) for (; *s; s++); if (!*s) s++; return LCTRANS_CUR(s); diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c old mode 100644 new mode 100755 index efaab306828e847deecbb26751dc7cb8a4c90e2e..97452d0c353eb5a5c5ffb889b28332d9e12b1a41 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "lookup.h" int getaddrinfo(const char *restrict host, const char *restrict serv, const struct addrinfo *restrict hint, struct addrinfo **restrict res) @@ -18,6 +19,8 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru int family = AF_UNSPEC, flags = 0, proto = 0, socktype = 0; struct aibuf *out; + unsupported_api(__FUNCTION__); + if (!host && !serv) return EAI_NONAME; if (hint) { diff --git a/src/network/gethostbyaddr.c b/src/network/gethostbyaddr.c old mode 100644 new mode 100755 index 598e2241a9f808e8ecafb72e24d7d6959cb49a28..03fdaf84074e3fd14ab0d0766540e9378fb2db4c --- a/src/network/gethostbyaddr.c +++ b/src/network/gethostbyaddr.c @@ -3,6 +3,7 @@ #include #include #include +#include struct hostent *gethostbyaddr(const void *a, socklen_t l, int af) { @@ -10,6 +11,7 @@ struct hostent *gethostbyaddr(const void *a, socklen_t l, int af) size_t size = 63; struct hostent *res; int err; + unsupported_api(__FUNCTION__); do { free(h); h = malloc(size+=size+1); diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c old mode 100644 new mode 100755 index 0f1e61aa0c358a1c7e6fcfc664772e7c77e99c92..ce4e3f67778798bcb8a8869ad40c4021f6db1777 --- a/src/network/gethostbyaddr_r.c +++ b/src/network/gethostbyaddr_r.c @@ -6,6 +6,7 @@ #include #include #include +#include int gethostbyaddr_r(const void *a, socklen_t l, int af, struct hostent *h, char *buf, size_t buflen, @@ -19,7 +20,7 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af, int i; *res = 0; - + unsupported_api(__FUNCTION__); /* Load address argument into sockaddr structure */ if (af==AF_INET6 && l==16) memcpy(&sa.sin6.sin6_addr, a, 16); else if (af==AF_INET && l==4) memcpy(&sa.sin.sin_addr, a, 4); diff --git a/src/network/gethostbyname.c b/src/network/gethostbyname.c old mode 100644 new mode 100755 index bfedf52ad65bfc6fb1b1c3304c67d9049aa584aa..80b427ca98ebcd7a0bc0a4da063f05af72c77e77 --- a/src/network/gethostbyname.c +++ b/src/network/gethostbyname.c @@ -4,8 +4,10 @@ #include #include #include +#include struct hostent *gethostbyname(const char *name) { + unsupported_api(__FUNCTION__); return gethostbyname2(name, AF_INET); } diff --git a/src/network/gethostbyname2.c b/src/network/gethostbyname2.c old mode 100644 new mode 100755 index dc9d6621be5655389327813001e8e49dfadbe79a..8410dd0b962e7e1f2e83e3bcb562d3238a741906 --- a/src/network/gethostbyname2.c +++ b/src/network/gethostbyname2.c @@ -4,6 +4,7 @@ #include #include #include +#include struct hostent *gethostbyname2(const char *name, int af) { @@ -11,6 +12,7 @@ struct hostent *gethostbyname2(const char *name, int af) size_t size = 63; struct hostent *res; int err; + unsupported_api(__FUNCTION__); do { free(h); h = malloc(size+=size+1); diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c old mode 100644 new mode 100755 index fc8948776d35ff7200c4139b8cf7885169e31cfd..853ef7cbcf3f5f7f13a20a86028819c17382213d --- a/src/network/gethostbyname2_r.c +++ b/src/network/gethostbyname2_r.c @@ -7,6 +7,7 @@ #include #include #include "lookup.h" +#include int gethostbyname2_r(const char *name, int af, struct hostent *h, char *buf, size_t buflen, @@ -18,6 +19,7 @@ int gethostbyname2_r(const char *name, int af, size_t align, need; *res = 0; + unsupported_api(__FUNCTION__); cnt = __lookup_name(addrs, canon, name, af, AI_CANONNAME); if (cnt<0) switch (cnt) { case EAI_NONAME: diff --git a/src/network/gethostbyname_r.c b/src/network/gethostbyname_r.c old mode 100644 new mode 100755 index cd8725417377284696d75344e8e679e14ae9cb7b..c89d6f2ecd2e72a0ab3c25510ed05eef9eea667c --- a/src/network/gethostbyname_r.c +++ b/src/network/gethostbyname_r.c @@ -2,10 +2,12 @@ #include #include +#include int gethostbyname_r(const char *name, struct hostent *h, char *buf, size_t buflen, struct hostent **res, int *err) { + unsupported_api(__FUNCTION__); return gethostbyname2_r(name, AF_INET, h, buf, buflen, res, err); } diff --git a/src/network/getifaddrs.c b/src/network/getifaddrs.c old mode 100644 new mode 100755 index fed75bd8d9293aa51c9e85461ca533dcf1d1ddae..09088957d1bf43213eb963ac90cca8c4de4ffa88 --- a/src/network/getifaddrs.c +++ b/src/network/getifaddrs.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "netlink.h" #define IFADDRS_HASH_SIZE 64 @@ -208,6 +209,7 @@ int getifaddrs(struct ifaddrs **ifap) { struct ifaddrs_ctx _ctx, *ctx = &_ctx; int r; + unsupported_api(__FUNCTION__); memset(ctx, 0, sizeof *ctx); r = __rtnetlink_enumerate(AF_UNSPEC, AF_UNSPEC, netlink_msg_to_ifaddr, ctx); if (r == 0) *ifap = &ctx->first->ifa; diff --git a/src/network/getnameinfo.c b/src/network/getnameinfo.c old mode 100644 new mode 100755 index f77e73ade89dea90bf427458468e678b80b5217b..9734c0c2591493f08da8e3e9ef97f3885d340cdb --- a/src/network/getnameinfo.c +++ b/src/network/getnameinfo.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "lookup.h" #include "stdio_impl.h" @@ -129,6 +130,7 @@ int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, unsigned char *a; unsigned scopeid; + unsupported_api(__FUNCTION__); switch (af) { case AF_INET: a = (void *)&((struct sockaddr_in *)sa)->sin_addr; diff --git a/src/network/getservbyname.c b/src/network/getservbyname.c old mode 100644 new mode 100755 index dd3037678c278536ce51cf6f296fc512175e7322..fb721bfda5be0fc71acc7664e1668702175e98fb --- a/src/network/getservbyname.c +++ b/src/network/getservbyname.c @@ -1,11 +1,13 @@ #define _GNU_SOURCE #include +#include struct servent *getservbyname(const char *name, const char *prots) { static struct servent se; static char *buf[2]; struct servent *res; + unsupported_api(__FUNCTION__); if (getservbyname_r(name, prots, &se, (void *)buf, sizeof buf, &res)) return 0; return &se; diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c old mode 100644 new mode 100755 index cad6317ab84243e5bc8de3a1d8ce17eb4a688a5e..3f03930e508dd8f2b0428e48395e096edf2b3b1e --- a/src/network/getservbyname_r.c +++ b/src/network/getservbyname_r.c @@ -7,6 +7,7 @@ #include #include #include "lookup.h" +#include #define ALIGN (sizeof(struct { char a; char *b; }) - sizeof(char *)) @@ -17,6 +18,7 @@ int getservbyname_r(const char *name, const char *prots, int cnt, proto, align; *res = 0; + unsupported_api(__FUNCTION__); /* Don't treat numeric port number strings as service records. */ char *end = ""; diff --git a/src/network/getservbyport.c b/src/network/getservbyport.c old mode 100644 new mode 100755 index c9ecbb11c869ccd1acb8a47bb039c45400870623..9aaeab0f0d9dde5ca00bfd767698b4e37ad1b34e --- a/src/network/getservbyport.c +++ b/src/network/getservbyport.c @@ -1,11 +1,13 @@ #define _GNU_SOURCE #include +#include struct servent *getservbyport(int port, const char *prots) { static struct servent se; static long buf[32/sizeof(long)]; struct servent *res; + unsupported_api(__FUNCTION__); if (getservbyport_r(port, prots, &se, (void *)buf, sizeof buf, &res)) return 0; return &se; diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c old mode 100644 new mode 100755 index b7f21c6b398a52c4eeb61ea9a94f12a1e88e7b71..18cfd6a72f378e867bad74586f32b1fc5b8990fb --- a/src/network/getservbyport_r.c +++ b/src/network/getservbyport_r.c @@ -6,6 +6,7 @@ #include #include #include +#include int getservbyport_r(int port, const char *prots, struct servent *se, char *buf, size_t buflen, struct servent **res) @@ -15,6 +16,7 @@ int getservbyport_r(int port, const char *prots, .sin_family = AF_INET, .sin_port = port, }; + unsupported_api(__FUNCTION__); if (!prots) { int r = getservbyport_r(port, "tcp", se, buf, buflen, res); diff --git a/src/network/if_indextoname.c b/src/network/if_indextoname.c old mode 100644 new mode 100755 index 3b368bf0d1329be7e9844da37a3bd78eff6914b0..d4fb019ce6382c0b098c701645ce900f44724cd0 --- a/src/network/if_indextoname.c +++ b/src/network/if_indextoname.c @@ -4,13 +4,14 @@ #include #include #include +#include #include "syscall.h" char *if_indextoname(unsigned index, char *name) { struct ifreq ifr; int fd, r; - + unsupported_api(__FUNCTION__); if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) return 0; ifr.ifr_ifindex = index; r = ioctl(fd, SIOCGIFNAME, &ifr); diff --git a/src/network/if_nameindex.c b/src/network/if_nameindex.c old mode 100644 new mode 100755 index 2deaef769600e5bb6b67d613eb3b3e1f65597383..a9990fa39ba6b9c45bb64ead391c62276e80383d --- a/src/network/if_nameindex.c +++ b/src/network/if_nameindex.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "netlink.h" #define IFADDRS_HASH_SIZE 64 diff --git a/src/network/if_nametoindex.c b/src/network/if_nametoindex.c old mode 100644 new mode 100755 index 331413c68912daf5157988df60f3605c8d818750..6447fe0980e814b2d994463dc43afec29a389096 --- a/src/network/if_nametoindex.c +++ b/src/network/if_nametoindex.c @@ -3,13 +3,14 @@ #include #include #include +#include #include "syscall.h" unsigned if_nametoindex(const char *name) { struct ifreq ifr; int fd, r; - + unsupported_api(__FUNCTION__); if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) return 0; strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name); r = ioctl(fd, SIOCGIFINDEX, &ifr); diff --git a/src/network/netname.c b/src/network/netname.c old mode 100644 new mode 100755 index ba6e665681ab76414a82c57114e34fb36653090c..1351b688d802ae2de1728039764749cde5c32fbd --- a/src/network/netname.c +++ b/src/network/netname.c @@ -1,12 +1,15 @@ #include +#include struct netent *getnetbyaddr(uint32_t net, int type) { + unsupported_api(__FUNCTION__); return 0; } struct netent *getnetbyname(const char *name) { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/network/proto.c b/src/network/proto.c old mode 100644 new mode 100755 index c4fd34efb0ad4883133573dc090b1b7692f5b012..f5b7db45a539c09e456806749654d3d679d4d7fd --- a/src/network/proto.c +++ b/src/network/proto.c @@ -1,5 +1,6 @@ #include #include +#include /* do we really need all these?? */ @@ -45,6 +46,7 @@ static const unsigned char protos[] = { void endprotoent(void) { + unsupported_api(__FUNCTION__); idx = 0; } diff --git a/src/network/serv.c b/src/network/serv.c old mode 100644 new mode 100755 index 41424e80637d71fe07a469cec972238575f97136..f7e4f209b353500d99d658e2c3db18b290713a56 --- a/src/network/serv.c +++ b/src/network/serv.c @@ -1,14 +1,18 @@ #include +#include void endservent(void) { + unsupported_api(__FUNCTION__); } void setservent(int stayopen) { + unsupported_api(__FUNCTION__); } struct servent *getservent(void) { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/network/sockatmark.c b/src/network/sockatmark.c old mode 100644 new mode 100755 index f474551aafe44b15eb90fd19b37fef5696d6a3a1..8162c8c7373439dd474c407181cb69e0909d18e4 --- a/src/network/sockatmark.c +++ b/src/network/sockatmark.c @@ -1,9 +1,11 @@ #include #include +#include int sockatmark(int s) { int ret; + unsupported_api(__FUNCTION__); if (ioctl(s, SIOCATMARK, &ret) < 0) return -1; return ret; diff --git a/src/passwd/getgr_r.c b/src/passwd/getgr_r.c old mode 100644 new mode 100755 index f3e8f603a32832505538c60e1d210c2e529df9c5..7ab45f552dae23694f5b94539add3206e19f39f5 --- a/src/passwd/getgr_r.c +++ b/src/passwd/getgr_r.c @@ -1,5 +1,6 @@ #include "pwf.h" #include +#include #define FIX(x) (gr->gr_##x = gr->gr_##x-line+buf) @@ -40,10 +41,12 @@ static int getgr_r(const char *name, gid_t gid, struct group *gr, char *buf, siz int getgrnam_r(const char *name, struct group *gr, char *buf, size_t size, struct group **res) { + unsupported_api(__FUNCTION__); return getgr_r(name, 0, gr, buf, size, res); } int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, struct group **res) { + unsupported_api(__FUNCTION__); return getgr_r(0, gid, gr, buf, size, res); } diff --git a/src/passwd/getgrent.c b/src/passwd/getgrent.c old mode 100644 new mode 100755 index 835b9ab5a22a7edf8b906d547626cdcaeff1d8e1..c84ef5e63cd09c3a8c4de07ca41555b947ae53b6 --- a/src/passwd/getgrent.c +++ b/src/passwd/getgrent.c @@ -1,3 +1,4 @@ +#include #include "pwf.h" static FILE *f; @@ -6,6 +7,7 @@ static struct group gr; void setgrent() { + unsupported_api(__FUNCTION__); if (f) fclose(f); f = 0; } @@ -16,6 +18,7 @@ struct group *getgrent() { struct group *res; size_t size=0, nmem=0; + unsupported_api(__FUNCTION__); if (!f) f = fopen("/etc/group", "rbe"); if (!f) return 0; __getgrent_a(f, &gr, &line, &size, &mem, &nmem, &res); @@ -26,6 +29,7 @@ struct group *getgrgid(gid_t gid) { struct group *res; size_t size=0, nmem=0; + unsupported_api(__FUNCTION__); __getgr_a(0, gid, &gr, &line, &size, &mem, &nmem, &res); return res; } @@ -34,6 +38,7 @@ struct group *getgrnam(const char *name) { struct group *res; size_t size=0, nmem=0; + unsupported_api(__FUNCTION__); __getgr_a(name, 0, &gr, &line, &size, &mem, &nmem, &res); return res; } diff --git a/src/passwd/getpw_r.c b/src/passwd/getpw_r.c old mode 100644 new mode 100755 index 0c87ab05d2700fdbe3ec727d824718f84ba8ba93..f09333d14fdb54a7d27a1f2773fbeb3bf9c84068 --- a/src/passwd/getpw_r.c +++ b/src/passwd/getpw_r.c @@ -1,5 +1,6 @@ #include "pwf.h" #include +#include #define FIX(x) (pw->pw_##x = pw->pw_##x-line+buf) @@ -33,6 +34,7 @@ static int getpw_r(const char *name, uid_t uid, struct passwd *pw, char *buf, si int getpwnam_r(const char *name, struct passwd *pw, char *buf, size_t size, struct passwd **res) { + unsupported_api(__FUNCTION__); return getpw_r(name, 0, pw, buf, size, res); } diff --git a/src/passwd/getpwent.c b/src/passwd/getpwent.c old mode 100644 new mode 100755 index f2bd516e57ba3261ab94c6081f692f77aaea4f47..1b5403187155bb2892d136db6c90c11f25d6cb71 --- a/src/passwd/getpwent.c +++ b/src/passwd/getpwent.c @@ -1,3 +1,4 @@ +#include #include "pwf.h" static FILE *f; @@ -7,6 +8,7 @@ static size_t size; void setpwent() { + unsupported_api(__FUNCTION__); if (f) fclose(f); f = 0; } @@ -16,6 +18,7 @@ weak_alias(setpwent, endpwent); struct passwd *getpwent() { struct passwd *res; + unsupported_api(__FUNCTION__); if (!f) f = fopen("/etc/passwd", "rbe"); if (!f) return 0; __getpwent_a(f, &pw, &line, &size, &res); @@ -25,6 +28,7 @@ struct passwd *getpwent() struct passwd *getpwuid(uid_t uid) { struct passwd *res; + unsupported_api(__FUNCTION__); __getpw_a(0, uid, &pw, &line, &size, &res); return res; } @@ -32,6 +36,7 @@ struct passwd *getpwuid(uid_t uid) struct passwd *getpwnam(const char *name) { struct passwd *res; + unsupported_api(__FUNCTION__); __getpw_a(name, 0, &pw, &line, &size, &res); return res; } diff --git a/src/process/fexecve.c b/src/process/fexecve.c old mode 100644 new mode 100755 index 554c1981b670f294b999295626e37b8bc5fc0b28..cc02ad936dec1b966d50abd99690773a22d13275 --- a/src/process/fexecve.c +++ b/src/process/fexecve.c @@ -3,9 +3,11 @@ #include #include #include "syscall.h" +#include int fexecve(int fd, char *const argv[], char *const envp[]) { + unsupported_api(__FUNCTION__); int r = __syscall(SYS_execveat, fd, "", argv, envp, AT_EMPTY_PATH); if (r != -ENOSYS) return __syscall_ret(r); char buf[15 + 3*sizeof(int)]; diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c old mode 100644 new mode 100755 index 29652197c58cbff007a3251b89a699e69dbbb2f7..5a5d94c69fb7bf2a84db4f1abfca4eb7b15fea02 --- a/src/process/posix_spawn.c +++ b/src/process/posix_spawn.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "syscall.h" #include "pthread_impl.h" #include "fdop.h" @@ -170,6 +171,7 @@ int posix_spawn(pid_t *restrict res, const char *restrict path, int ec=0, cs; struct args args; + unsupported_api(__FUNCTION__); if (pipe2(args.p, O_CLOEXEC)) return errno; diff --git a/src/process/posix_spawn_file_actions_addclose.c b/src/process/posix_spawn_file_actions_addclose.c old mode 100644 new mode 100755 index cdda5979916dd1437cc1e0249617847291fcd3e9..7f6fc85697c6c52a0223cdd114b289de58e4de03 --- a/src/process/posix_spawn_file_actions_addclose.c +++ b/src/process/posix_spawn_file_actions_addclose.c @@ -2,9 +2,11 @@ #include #include #include "fdop.h" +#include int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *fa, int fd) { + unsupported_api(__FUNCTION__); struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_CLOSE; diff --git a/src/process/posix_spawn_file_actions_adddup2.c b/src/process/posix_spawn_file_actions_adddup2.c old mode 100644 new mode 100755 index 0367498fd4f36ca9fe5d0ae12ec65fc15936bc5b..19e51811639a06fa8e8d383e0184918c03f6e609 --- a/src/process/posix_spawn_file_actions_adddup2.c +++ b/src/process/posix_spawn_file_actions_adddup2.c @@ -2,9 +2,11 @@ #include #include #include "fdop.h" +#include int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *fa, int srcfd, int fd) { + unsupported_api(__FUNCTION__); struct fdop *op = malloc(sizeof *op); if (!op) return ENOMEM; op->cmd = FDOP_DUP2; diff --git a/src/process/posix_spawn_file_actions_addopen.c b/src/process/posix_spawn_file_actions_addopen.c old mode 100644 new mode 100755 index 368922c76b5259944059bad15d1c1d9d8e79fce5..35c52d3c66178a3afc1003afe28c2ae17e103ae1 --- a/src/process/posix_spawn_file_actions_addopen.c +++ b/src/process/posix_spawn_file_actions_addopen.c @@ -3,9 +3,11 @@ #include #include #include "fdop.h" +#include int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict fa, int fd, const char *restrict path, int flags, mode_t mode) { + unsupported_api(__FUNCTION__); struct fdop *op = malloc(sizeof *op + strlen(path) + 1); if (!op) return ENOMEM; op->cmd = FDOP_OPEN; diff --git a/src/process/posix_spawnattr_destroy.c b/src/process/posix_spawnattr_destroy.c old mode 100644 new mode 100755 index fc714a1b246d44f4a47773bf402b559e589d24a1..b66614fc4ca04e5ffe29223fbf52ff25fb6d4a57 --- a/src/process/posix_spawnattr_destroy.c +++ b/src/process/posix_spawnattr_destroy.c @@ -1,6 +1,8 @@ #include +#include int posix_spawnattr_destroy(posix_spawnattr_t *attr) { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/process/posix_spawnattr_getflags.c b/src/process/posix_spawnattr_getflags.c old mode 100644 new mode 100755 index aa635ddaf6a1703b1237608d540729a544e6d48e..d3942db776b5609d7515ead08e41bd8d54806186 --- a/src/process/posix_spawnattr_getflags.c +++ b/src/process/posix_spawnattr_getflags.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_getflags(const posix_spawnattr_t *restrict attr, short *restrict flags) { + unsupported_api(__FUNCTION__); *flags = attr->__flags; return 0; } diff --git a/src/process/posix_spawnattr_getpgroup.c b/src/process/posix_spawnattr_getpgroup.c old mode 100644 new mode 100755 index 0480527d6fa79a76507357366f38a5de7ce3c420..be42a87e238cb0ffd14d780bda078be8743f56bf --- a/src/process/posix_spawnattr_getpgroup.c +++ b/src/process/posix_spawnattr_getpgroup.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict attr, pid_t *restrict pgrp) { + unsupported_api(__FUNCTION__); *pgrp = attr->__pgrp; return 0; } diff --git a/src/process/posix_spawnattr_getsigdefault.c b/src/process/posix_spawnattr_getsigdefault.c old mode 100644 new mode 100755 index a49050aa4f7cdc7bbf9b6f3fc738ea74de0b8ca0..6687b86405de6348900aa7fdffd4889799d74d48 --- a/src/process/posix_spawnattr_getsigdefault.c +++ b/src/process/posix_spawnattr_getsigdefault.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict attr, sigset_t *restrict def) { + unsupported_api(__FUNCTION__); *def = attr->__def; return 0; } diff --git a/src/process/posix_spawnattr_getsigmask.c b/src/process/posix_spawnattr_getsigmask.c old mode 100644 new mode 100755 index f60ad7f37531b9ba057b725d2b86083de458f010..5d56dae472f5cf3fa58f630a5f63daaedab07d30 --- a/src/process/posix_spawnattr_getsigmask.c +++ b/src/process/posix_spawnattr_getsigmask.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict attr, sigset_t *restrict mask) { + unsupported_api(__FUNCTION__); *mask = attr->__mask; return 0; } diff --git a/src/process/posix_spawnattr_init.c b/src/process/posix_spawnattr_init.c old mode 100644 new mode 100755 index 0dcd868f3c61450a84f94e86fa3261e4c5230469..cf2dc275449140689bf922a05981da37e6048b2b --- a/src/process/posix_spawnattr_init.c +++ b/src/process/posix_spawnattr_init.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_init(posix_spawnattr_t *attr) { + unsupported_api(__FUNCTION__); *attr = (posix_spawnattr_t){ 0 }; return 0; } diff --git a/src/process/posix_spawnattr_sched.c b/src/process/posix_spawnattr_sched.c old mode 100644 new mode 100755 index 3143635bacc4f43b356affbf2a401e673bc7a1e4..f7a3cc03f1814d448147eac0c91328799037c642 --- a/src/process/posix_spawnattr_sched.c +++ b/src/process/posix_spawnattr_sched.c @@ -1,25 +1,30 @@ #include #include #include +#include int posix_spawnattr_getschedparam(const posix_spawnattr_t *restrict attr, struct sched_param *restrict schedparam) { + unsupported_api(__FUNCTION__); return ENOSYS; } int posix_spawnattr_setschedparam(posix_spawnattr_t *restrict attr, const struct sched_param *restrict schedparam) { + unsupported_api(__FUNCTION__); return ENOSYS; } int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *restrict attr, int *restrict policy) { + unsupported_api(__FUNCTION__); return ENOSYS; } int posix_spawnattr_setschedpolicy(posix_spawnattr_t *attr, int policy) { + unsupported_api(__FUNCTION__); return ENOSYS; } diff --git a/src/process/posix_spawnattr_setflags.c b/src/process/posix_spawnattr_setflags.c old mode 100644 new mode 100755 index 687809921242681c802192bd45a99d0373a91f89..afeb2af5fb55c17a4a9977da451708d72b2c8ea7 --- a/src/process/posix_spawnattr_setflags.c +++ b/src/process/posix_spawnattr_setflags.c @@ -1,8 +1,10 @@ #include #include +#include int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags) { + unsupported_api(__FUNCTION__); const unsigned all_flags = POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | diff --git a/src/process/posix_spawnattr_setpgroup.c b/src/process/posix_spawnattr_setpgroup.c old mode 100644 new mode 100755 index f39596a6ec62d2dacc4ae6b6ac1a379940b77519..217cb9e0b3495a8b57c4a9a7436d54414b344fb8 --- a/src/process/posix_spawnattr_setpgroup.c +++ b/src/process/posix_spawnattr_setpgroup.c @@ -1,7 +1,9 @@ #include +#include int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgrp) { + unsupported_api(__FUNCTION__); attr->__pgrp = pgrp; return 0; } diff --git a/src/process/posix_spawnattr_setsigdefault.c b/src/process/posix_spawnattr_setsigdefault.c old mode 100644 new mode 100755 index 5686972670a519dd5f10ad6b727f70b4cf3f308c..4c142b3438d668810cddf0ca779d05d13ca6b18c --- a/src/process/posix_spawnattr_setsigdefault.c +++ b/src/process/posix_spawnattr_setsigdefault.c @@ -1,7 +1,10 @@ #include +#include int posix_spawnattr_setsigdefault(posix_spawnattr_t *restrict attr, const sigset_t *restrict def) { + unsupported_api(__FUNCTION__); + attr->__def = *def; return 0; } diff --git a/src/process/posix_spawnattr_setsigmask.c b/src/process/posix_spawnattr_setsigmask.c old mode 100644 new mode 100755 index f2532f8e0ea066e545dea36770bc9268068d28da..46173effeb26a07caa834749dbf359333c3e37a4 --- a/src/process/posix_spawnattr_setsigmask.c +++ b/src/process/posix_spawnattr_setsigmask.c @@ -1,7 +1,10 @@ #include +#include int posix_spawnattr_setsigmask(posix_spawnattr_t *restrict attr, const sigset_t *restrict mask) { + unsupported_api(__FUNCTION__); + attr->__mask = *mask; return 0; } diff --git a/src/process/posix_spawnp.c b/src/process/posix_spawnp.c old mode 100644 new mode 100755 index aad6133b919287daa4219aed26901efb702260e6..e1ac20d68f58739ad3e1dca5336ebc66af548e26 --- a/src/process/posix_spawnp.c +++ b/src/process/posix_spawnp.c @@ -1,5 +1,6 @@ #include #include +#include int posix_spawnp(pid_t *restrict res, const char *restrict file, const posix_spawn_file_actions_t *fa, @@ -7,7 +8,8 @@ int posix_spawnp(pid_t *restrict res, const char *restrict file, char *const argv[restrict], char *const envp[restrict]) { posix_spawnattr_t spawnp_attr = { 0 }; + unsupported_api(__FUNCTION__); if (attr) spawnp_attr = *attr; - spawnp_attr.__fn = (void *)__execvpe; + spawnp_attr.__fn = (void *)__execvpe; return posix_spawn(res, file, fa, &spawnp_attr, argv, envp); } diff --git a/src/process/system.c b/src/process/system.c old mode 100644 new mode 100755 index 5af59b809f18d309e240d057177af6788a3b54be..50aaa7532f02206bb773850b92c58497d26c0461 --- a/src/process/system.c +++ b/src/process/system.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "pthread_impl.h" extern char **__environ; @@ -16,6 +17,8 @@ int system(const char *cmd) int status = -1, ret; posix_spawnattr_t attr; + unsupported_api(__FUNCTION__); + pthread_testcancel(); if (!cmd) return 1; diff --git a/src/process/waitid.c b/src/process/waitid.c old mode 100644 new mode 100755 index d688650d8555954f4cb970e7711a032a47dcef43..6622e06dcd69dd7a110b6900f694769c2dfdf844 --- a/src/process/waitid.c +++ b/src/process/waitid.c @@ -1,7 +1,9 @@ #include +#include #include "syscall.h" int waitid(idtype_t type, id_t id, siginfo_t *info, int options) { + unsupported_api(__FUNCTION__); return syscall_cp(SYS_waitid, type, id, info, options, 0); } diff --git a/src/select/pselect.c b/src/select/pselect.c old mode 100644 new mode 100755 index 54cfb291bba2cbf7c73dfb9bea3a77f0f8870d2e..ef454b37961e218d1170e31163e120848456b59b --- a/src/select/pselect.c +++ b/src/select/pselect.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "syscall.h" #define IS32BIT(x) !((x)+0x80000000ULL>>32) @@ -12,6 +13,7 @@ int pselect(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restric syscall_arg_t data[2] = { (uintptr_t)mask, _NSIG/8 }; time_t s = ts ? ts->tv_sec : 0; long ns = ts ? ts->tv_nsec : 0; + unsupported_api(__FUNCTION__); #ifdef SYS_pselect6_time64 int r = -ENOSYS; if (SYS_pselect6 == SYS_pselect6_time64 || !IS32BIT(s)) diff --git a/src/signal/killpg.c b/src/signal/killpg.c old mode 100644 new mode 100755 index 315ed44747a5009eeb800767dc4f670887140404..238b69bdc74ddec982e86f41955ef1f355356a22 --- a/src/signal/killpg.c +++ b/src/signal/killpg.c @@ -1,8 +1,10 @@ #include #include +#include int killpg(pid_t pgid, int sig) { + unsupported_api(__FUNCTION__); if (pgid < 0) { errno = EINVAL; return -1; diff --git a/src/signal/psiginfo.c b/src/signal/psiginfo.c old mode 100644 new mode 100755 index 2b15982be488dfe4a5b89026edff237fbcb4e13f..bdf5cae399492e6c12657612baeba2487f861c2a --- a/src/signal/psiginfo.c +++ b/src/signal/psiginfo.c @@ -1,6 +1,8 @@ #include +#include void psiginfo(const siginfo_t *si, const char *msg) { + unsupported_api(__FUNCTION__); psignal(si->si_signo, msg); } diff --git a/src/signal/sigaltstack.c b/src/signal/sigaltstack.c old mode 100644 new mode 100755 index d3a6e8215f83c3d0a8038a6d0eee2bc228b104e5..619e387503e35b467b9beea4e5208ec49e314677 --- a/src/signal/sigaltstack.c +++ b/src/signal/sigaltstack.c @@ -1,9 +1,12 @@ #include #include +#include + #include "syscall.h" int sigaltstack(const stack_t *restrict ss, stack_t *restrict old) { + unsupported_api(__FUNCTION__); if (ss) { if (!(ss->ss_flags & SS_DISABLE) && ss->ss_size < MINSIGSTKSZ) { errno = ENOMEM; diff --git a/src/signal/siginterrupt.c b/src/signal/siginterrupt.c old mode 100644 new mode 100755 index 70063400325c0f74f82235ffc4b9440dd4e264f2..487318b4a2f7bd8694653a69b9974ae046799b73 --- a/src/signal/siginterrupt.c +++ b/src/signal/siginterrupt.c @@ -1,9 +1,10 @@ #include +#include int siginterrupt(int sig, int flag) { struct sigaction sa; - + unsupported_api(__FUNCTION__); sigaction(sig, 0, &sa); if (flag) sa.sa_flags &= ~SA_RESTART; else sa.sa_flags |= SA_RESTART; diff --git a/src/signal/siglongjmp.c b/src/signal/siglongjmp.c old mode 100644 new mode 100755 index bc317acce93176a939f6de518cbe67d81284bdfd..803f2dd8649dc36ac3f126246e7f28dc0efcd44f --- a/src/signal/siglongjmp.c +++ b/src/signal/siglongjmp.c @@ -1,9 +1,12 @@ #include #include +#include + #include "syscall.h" #include "pthread_impl.h" _Noreturn void siglongjmp(sigjmp_buf buf, int ret) { + unsupported_api(__FUNCTION__); longjmp(buf, ret); } diff --git a/src/signal/sigqueue.c b/src/signal/sigqueue.c old mode 100644 new mode 100755 index b75f0c5cea42f7f03a23ef3f130d1c507f8c2df4..e169defa089b6d9943371d6c6005412529fb4a8d --- a/src/signal/sigqueue.c +++ b/src/signal/sigqueue.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include "syscall.h" #include "pthread_impl.h" @@ -9,6 +11,7 @@ int sigqueue(pid_t pid, int sig, const union sigval value) siginfo_t si; sigset_t set; int r; + unsupported_api(__FUNCTION__); memset(&si, 0, sizeof si); si.si_signo = sig; si.si_code = SI_QUEUE; diff --git a/src/stat/fchmod.c b/src/stat/fchmod.c old mode 100644 new mode 100755 index 7a503eefc46efbee86e018202cb19fb2f2fd0271..7e469a93126db42fc52cc765e4ce45cb684cc4c3 --- a/src/stat/fchmod.c +++ b/src/stat/fchmod.c @@ -1,10 +1,13 @@ #include #include #include +#include + #include "syscall.h" int fchmod(int fd, mode_t mode) { + unsupported_api(__FUNCTION__); int ret = __syscall(SYS_fchmod, fd, mode); if (ret != -EBADF || __syscall(SYS_fcntl, fd, F_GETFD) < 0) return __syscall_ret(ret); diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c old mode 100644 new mode 100755 index 4ee00b0a3ed18cb1ce15c62ff4ce517c7bbf9ece..2c777e1b7a2a6294df57e575beea3362536904fa --- a/src/stat/fchmodat.c +++ b/src/stat/fchmodat.c @@ -1,11 +1,14 @@ #include #include #include +#include + #include "syscall.h" #include "kstat.h" int fchmodat(int fd, const char *path, mode_t mode, int flag) { + unsupported_api(__FUNCTION__); if (!flag) return syscall(SYS_fchmodat, fd, path, mode, flag); if (flag != AT_SYMLINK_NOFOLLOW) diff --git a/src/stat/futimens.c b/src/stat/futimens.c old mode 100644 new mode 100755 index 360225b86c42087e74258a72a13f450285ef4555..2ab329a08afbaaeb86e99c83abf1240e9bf2151b --- a/src/stat/futimens.c +++ b/src/stat/futimens.c @@ -1,6 +1,8 @@ #include +#include int futimens(int fd, const struct timespec times[2]) { + unsupported_api(__FUNCTION__); return utimensat(fd, 0, times, 0); } diff --git a/src/stat/mkfifoat.c b/src/stat/mkfifoat.c old mode 100644 new mode 100755 index d3a1f9708775e9e5835b6c055315bac43ba0a09a..768a31786733b31456f89616cb5f118996b52376 --- a/src/stat/mkfifoat.c +++ b/src/stat/mkfifoat.c @@ -1,6 +1,8 @@ #include +#include int mkfifoat(int fd, const char *path, mode_t mode) { + unsupported_api(__FUNCTION__); return mknodat(fd, path, mode | S_IFIFO, 0); } diff --git a/src/stat/mknod.c b/src/stat/mknod.c old mode 100644 new mode 100755 index beebd84e08995c36064ea67706ab7e48d95a48a1..5c40a9ee97a9ed48b0ab1e69725e88450a8c246d --- a/src/stat/mknod.c +++ b/src/stat/mknod.c @@ -1,9 +1,11 @@ #include #include #include "syscall.h" +#include int mknod(const char *path, mode_t mode, dev_t dev) { + unsupported_api(__FUNCTION__); #ifdef SYS_mknod return syscall(SYS_mknod, path, mode, dev); #else diff --git a/src/stat/mknodat.c b/src/stat/mknodat.c old mode 100644 new mode 100755 index 7c97c91aaa58bf5ae2a0be33348ad01f3fd8baac..15510c456ed24dce74581baccdd724d5c5c6ae91 --- a/src/stat/mknodat.c +++ b/src/stat/mknodat.c @@ -1,7 +1,9 @@ #include #include "syscall.h" +#include int mknodat(int fd, const char *path, mode_t mode, dev_t dev) { + unsupported_api(__FUNCTION__); return syscall(SYS_mknodat, fd, path, mode, dev); } diff --git a/src/stat/statvfs.c b/src/stat/statvfs.c old mode 100644 new mode 100755 index f65d1b548d41eae429223ddca818b3a71ba8d6b7..c7f14a04b8cbfa4cc82c37cc7acd0dfcd9965314 --- a/src/stat/statvfs.c +++ b/src/stat/statvfs.c @@ -1,5 +1,7 @@ #include #include +#include + #include "syscall.h" static int __statfs(const char *path, struct statfs *buf) @@ -14,6 +16,7 @@ static int __statfs(const char *path, struct statfs *buf) static int __fstatfs(int fd, struct statfs *buf) { + unsupported_api(__FUNCTION__); *buf = (struct statfs){0}; #ifdef SYS_fstatfs64 return syscall(SYS_fstatfs64, fd, sizeof *buf, buf); @@ -52,6 +55,8 @@ int statvfs(const char *restrict path, struct statvfs *restrict buf) int fstatvfs(int fd, struct statvfs *buf) { struct statfs kbuf; + + unsupported_api(__FUNCTION__); if (__fstatfs(fd, &kbuf)<0) return -1; fixup(buf, &kbuf); return 0; diff --git a/src/stat/utimensat.c b/src/stat/utimensat.c old mode 100644 new mode 100755 index 730723a9ea70d4f88e20155f1f7e33b366a2281e..ed3283eb80001b228408e8e897988e69c398b220 --- a/src/stat/utimensat.c +++ b/src/stat/utimensat.c @@ -2,6 +2,8 @@ #include #include #include +#include + #include "syscall.h" #define IS32BIT(x) !((x)+0x80000000ULL>>32) @@ -10,6 +12,7 @@ int utimensat(int fd, const char *path, const struct timespec times[2], int flags) { int r; + unsupported_api(__FUNCTION__); if (times && times[0].tv_nsec==UTIME_NOW && times[1].tv_nsec==UTIME_NOW) times = 0; #ifdef SYS_utimensat_time64 diff --git a/src/stdio/flockfile.c b/src/stdio/flockfile.c old mode 100644 new mode 100755 index 8e2206514c67db4bd05aef79484ad110a07170ed..eb1771bcd7bfca3c726c59731aa729000f0dec54 --- a/src/stdio/flockfile.c +++ b/src/stdio/flockfile.c @@ -1,8 +1,11 @@ +#include + #include "stdio_impl.h" #include "pthread_impl.h" void flockfile(FILE *f) { + unsupported_api(__FUNCTION__); if (!ftrylockfile(f)) return; __lockfile(f); __register_locked_file(f, __pthread_self()); diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c old mode 100644 new mode 100755 index 615d4b47bdbe8ef32bc84a4c58b708dc78aa8299..603bddd348ab73a1fe8dbf30ba6ee3620d241715 --- a/src/stdio/freopen.c +++ b/src/stdio/freopen.c @@ -1,6 +1,7 @@ #include "stdio_impl.h" #include #include +#include /* The basic idea of this implementation is to open a new FILE, * hack the necessary parts of the new FILE into the old one, then @@ -15,6 +16,7 @@ FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *re int fl = __fmodeflags(mode); FILE *f2; + unsupported_api(__FUNCTION__); FLOCK(f); fflush(f); diff --git a/src/stdio/open_wmemstream.c b/src/stdio/open_wmemstream.c old mode 100644 new mode 100755 index ed1b561d9c92fa0ce787692dbd27d369292dd0a5..760da562bfabd5be3a978aed78c1514cc78402b4 --- a/src/stdio/open_wmemstream.c +++ b/src/stdio/open_wmemstream.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "libc.h" struct cookie { @@ -70,6 +71,7 @@ FILE *open_wmemstream(wchar_t **bufp, size_t *sizep) struct wms_FILE *f; wchar_t *buf; + unsupported_api(__FUNCTION__); if (!(f=malloc(sizeof *f))) return 0; if (!(buf=malloc(sizeof *buf))) { free(f); diff --git a/src/stdio/popen.c b/src/stdio/popen.c old mode 100644 new mode 100755 index 92cb57ee937b7ea3908de2c0de86ced5eefb3d8d..c75e27f682c09c151a0fb74a86b3ba5a03a0e219 --- a/src/stdio/popen.c +++ b/src/stdio/popen.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "stdio_impl.h" #include "syscall.h" @@ -15,6 +16,7 @@ FILE *popen(const char *cmd, const char *mode) FILE *f; posix_spawn_file_actions_t fa; + unsupported_api(__FUNCTION__); if (*mode == 'r') { op = 0; } else if (*mode == 'w') { @@ -23,7 +25,7 @@ FILE *popen(const char *cmd, const char *mode) errno = EINVAL; return 0; } - + if (pipe2(p, O_CLOEXEC)) return NULL; f = fdopen(p[op], mode); if (!f) { diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c old mode 100644 new mode 100755 index ae493987b8a7d43f89c4e1eed86cdd81fba7756c..ad02d4bed65838b8eb86c08c3e194bdfa44c3267 --- a/src/stdio/tmpfile.c +++ b/src/stdio/tmpfile.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include "stdio_impl.h" #define MAXTRIES 100 @@ -11,6 +13,7 @@ FILE *tmpfile(void) int fd; FILE *f; int try; + unsupported_api(__FUNCTION__); for (try=0; try #include #include +#include + #include "syscall.h" #include "kstat.h" @@ -15,6 +17,7 @@ char *tmpnam(char *buf) char s[] = "/tmp/tmpnam_XXXXXX"; int try; int r; + unsupported_api(__FUNCTION__); for (try=0; try #include +#include int strcasecmp(const char *_l, const char *_r) { @@ -10,6 +11,7 @@ int strcasecmp(const char *_l, const char *_r) int __strcasecmp_l(const char *l, const char *r, locale_t loc) { + unsupported_api(__FUNCTION__); return strcasecmp(l, r); } diff --git a/src/string/strncasecmp.c b/src/string/strncasecmp.c old mode 100644 new mode 100755 index e0ef93c20de1a9e0a6b8f4a4a951a8e61a1a2973..2b8143a0c40df8f5a367cf682212368d565c1ef9 --- a/src/string/strncasecmp.c +++ b/src/string/strncasecmp.c @@ -1,5 +1,6 @@ #include #include +#include int strncasecmp(const char *_l, const char *_r, size_t n) { @@ -11,6 +12,7 @@ int strncasecmp(const char *_l, const char *_r, size_t n) int __strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc) { + unsupported_api(__FUNCTION__); return strncasecmp(l, r, n); } diff --git a/src/termios/cfsetospeed.c b/src/termios/cfsetospeed.c old mode 100644 new mode 100755 index c9cbdd9d9d2e1f7f3ba78567fc13fae28ad721d7..5e4be9396e47f11d4c2cd1356ca16510bb7bd3bb --- a/src/termios/cfsetospeed.c +++ b/src/termios/cfsetospeed.c @@ -2,9 +2,11 @@ #include #include #include +#include int cfsetospeed(struct termios *tio, speed_t speed) { + unsupported_api(__FUNCTION__); if (speed & ~CBAUD) { errno = EINVAL; return -1; @@ -16,6 +18,7 @@ int cfsetospeed(struct termios *tio, speed_t speed) int cfsetispeed(struct termios *tio, speed_t speed) { + unsupported_api(__FUNCTION__); return speed ? cfsetospeed(tio, speed) : 0; } diff --git a/src/thread/pthread_attr_destroy.c b/src/thread/pthread_attr_destroy.c old mode 100644 new mode 100755 index b5845dd0f5afd6bb437b1992d9e19707dd2db87c..03e56edf1c52b5937fd0944ac43a6d89e4f84eb3 --- a/src/thread/pthread_attr_destroy.c +++ b/src/thread/pthread_attr_destroy.c @@ -1,6 +1,8 @@ +#include #include "pthread_impl.h" int pthread_attr_destroy(pthread_attr_t *a) { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/thread/pthread_attr_get.c b/src/thread/pthread_attr_get.c old mode 100644 new mode 100755 index b2196cba7a01e853033108d84433ab0c85793b1f..245c81176aa150e8fd112cc04959f5f3ed36bab2 --- a/src/thread/pthread_attr_get.c +++ b/src/thread/pthread_attr_get.c @@ -1,42 +1,50 @@ +#include #include "pthread_impl.h" int pthread_attr_getdetachstate(const pthread_attr_t *a, int *state) { + unsupported_api(__FUNCTION__); *state = a->_a_detach; return 0; } int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size) { + unsupported_api(__FUNCTION__); *size = a->_a_guardsize; return 0; } int pthread_attr_getinheritsched(const pthread_attr_t *restrict a, int *restrict inherit) { + unsupported_api(__FUNCTION__); *inherit = a->_a_sched; return 0; } int pthread_attr_getschedparam(const pthread_attr_t *restrict a, struct sched_param *restrict param) { + unsupported_api(__FUNCTION__); param->sched_priority = a->_a_prio; return 0; } int pthread_attr_getschedpolicy(const pthread_attr_t *restrict a, int *restrict policy) { + unsupported_api(__FUNCTION__); *policy = a->_a_policy; return 0; } int pthread_attr_getscope(const pthread_attr_t *restrict a, int *restrict scope) { + unsupported_api(__FUNCTION__); *scope = PTHREAD_SCOPE_PROCESS; return 0; } int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr, size_t *restrict size) { + unsupported_api(__FUNCTION__); if (!a->_a_stackaddr) return EINVAL; *size = a->_a_stacksize; @@ -46,53 +54,62 @@ int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size) { + unsupported_api(__FUNCTION__); *size = a->_a_stacksize; return 0; } int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict a, int *restrict pshared) { + unsupported_api(__FUNCTION__); *pshared = !!a->__attr; return 0; } int pthread_condattr_getclock(const pthread_condattr_t *restrict a, clockid_t *restrict clk) { + unsupported_api(__FUNCTION__); *clk = a->__attr & 0x7fffffff; return 0; } int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restrict pshared) { + unsupported_api(__FUNCTION__); *pshared = a->__attr>>31; return 0; } int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol) { + unsupported_api(__FUNCTION__); *protocol = PTHREAD_PRIO_NONE; return 0; } int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared) { + unsupported_api(__FUNCTION__); *pshared = a->__attr / 128U % 2; return 0; } int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict a, int *restrict robust) { + unsupported_api(__FUNCTION__); *robust = a->__attr / 4U % 2; return 0; } int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict a, int *restrict type) { + unsupported_api(__FUNCTION__); *type = a->__attr & 3; return 0; } int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *restrict pshared) { + unsupported_api(__FUNCTION__); *pshared = a->__attr[0]; return 0; } diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c old mode 100644 new mode 100755 index c2d2929dcf8e975fd8d743800eb78dfc2be4c9db..fa8d8ef15c6602f58d2c1760e4f9dbc476f65020 --- a/src/thread/pthread_barrierattr_setpshared.c +++ b/src/thread/pthread_barrierattr_setpshared.c @@ -1,7 +1,9 @@ +#include #include "pthread_impl.h" int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared) { + unsupported_api(__FUNCTION__); if (pshared > 1U) return EINVAL; a->__attr = pshared ? INT_MIN : 0; return 0; diff --git a/src/thread/pthread_condattr_setpshared.c b/src/thread/pthread_condattr_setpshared.c old mode 100644 new mode 100755 index 51453e0480a822aa88f3797c586d6ceb2e4bb7b3..f1dc65948c5bc90a13eec607c66b9ba8f72704e1 --- a/src/thread/pthread_condattr_setpshared.c +++ b/src/thread/pthread_condattr_setpshared.c @@ -1,7 +1,9 @@ +#include #include "pthread_impl.h" int pthread_condattr_setpshared(pthread_condattr_t *a, int pshared) { + unsupported_api(__FUNCTION__); if (pshared > 1U) return EINVAL; a->__attr &= 0x7fffffff; a->__attr |= (unsigned)pshared<<31; diff --git a/src/thread/pthread_getconcurrency.c b/src/thread/pthread_getconcurrency.c old mode 100644 new mode 100755 index 269429a8abca8549f5c7e00da5d62efb91b1ead2..4156988eed2032660679211b18b9f312d30ae87e --- a/src/thread/pthread_getconcurrency.c +++ b/src/thread/pthread_getconcurrency.c @@ -1,6 +1,8 @@ #include +#include int pthread_getconcurrency() { + unsupported_api(__FUNCTION__); return 0; } diff --git a/src/thread/pthread_mutex_consistent.c b/src/thread/pthread_mutex_consistent.c old mode 100644 new mode 100755 index 27c74e5b6a0100ed18d826eeff3b994917160617..52cc962c5b7517ee812b4ffb9aa6d656705903f6 --- a/src/thread/pthread_mutex_consistent.c +++ b/src/thread/pthread_mutex_consistent.c @@ -1,8 +1,11 @@ +#include #include "pthread_impl.h" #include "atomic.h" int pthread_mutex_consistent(pthread_mutex_t *m) { + unsupported_api(__FUNCTION__); + int old = m->_m_lock; int own = old & 0x3fffffff; if (!(m->_m_type & 4) || !own || !(old & 0x40000000)) diff --git a/src/thread/pthread_mutex_getprioceiling.c b/src/thread/pthread_mutex_getprioceiling.c old mode 100644 new mode 100755 index 8c75a6612c89821d83aa9cde5038f3de8260ffec..c6699947f4b1c2fd04fa1680ff91f055c4c4c93b --- a/src/thread/pthread_mutex_getprioceiling.c +++ b/src/thread/pthread_mutex_getprioceiling.c @@ -1,6 +1,8 @@ +#include #include "pthread_impl.h" int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict m, int *restrict ceiling) { + unsupported_api(__FUNCTION__); return EINVAL; } diff --git a/src/thread/pthread_mutexattr_setprotocol.c b/src/thread/pthread_mutexattr_setprotocol.c old mode 100644 new mode 100755 index 511cc32d8f0ad9df99d4193901dbb514160f928e..cde69b8a119561cdeac15a6ae96d56c30c89f353 --- a/src/thread/pthread_mutexattr_setprotocol.c +++ b/src/thread/pthread_mutexattr_setprotocol.c @@ -1,4 +1,5 @@ #include "pthread_impl.h" +#include #include "syscall.h" static pthread_once_t check_pi_once; @@ -12,6 +13,7 @@ static void check_pi() int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int protocol) { + unsupported_api(__FUNCTION__); switch (protocol) { case PTHREAD_PRIO_NONE: a->__attr &= ~8; diff --git a/src/thread/pthread_mutexattr_setrobust.c b/src/thread/pthread_mutexattr_setrobust.c old mode 100644 new mode 100755 index 04db92a626dbd0b05eac4bcd88363a6e31e54207..859350db383f003d90aff37ccbb6592f22dd7405 --- a/src/thread/pthread_mutexattr_setrobust.c +++ b/src/thread/pthread_mutexattr_setrobust.c @@ -1,4 +1,5 @@ #include "pthread_impl.h" +#include #include "syscall.h" static pthread_once_t check_robust_once; @@ -13,6 +14,7 @@ static void check_robust() int pthread_mutexattr_setrobust(pthread_mutexattr_t *a, int robust) { + unsupported_api(__FUNCTION__); if (robust > 1U) return EINVAL; if (robust) { pthread_once(&check_robust_once, check_robust); diff --git a/src/thread/pthread_rwlockattr_setpshared.c b/src/thread/pthread_rwlockattr_setpshared.c old mode 100644 new mode 100755 index e7061973d6d6b1c00a79cd2c3cd4bb04b0f104d7..1f88afda05356c809f4a67a1e528dc9ff3e061c1 --- a/src/thread/pthread_rwlockattr_setpshared.c +++ b/src/thread/pthread_rwlockattr_setpshared.c @@ -1,7 +1,9 @@ +#include #include "pthread_impl.h" int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int pshared) { + unsupported_api(__FUNCTION__); if (pshared > 1U) return EINVAL; a->__attr[0] = pshared; return 0; diff --git a/src/thread/pthread_setconcurrency.c b/src/thread/pthread_setconcurrency.c old mode 100644 new mode 100755 index 091abf98c86f3e23c921f0c3e83a8ba6b58b0052..a394233321ff4a6882edb3aee56e931b45f41f4a --- a/src/thread/pthread_setconcurrency.c +++ b/src/thread/pthread_setconcurrency.c @@ -1,8 +1,10 @@ #include #include +#include int pthread_setconcurrency(int val) { + unsupported_api(__FUNCTION__); if (val < 0) return EINVAL; if (val > 0) return EAGAIN; return 0; diff --git a/src/thread/pthread_setschedparam.c b/src/thread/pthread_setschedparam.c old mode 100644 new mode 100755 index 1d781d132bf3495556e6723d5b39232b5810927a..73a5fd4475890527844901c255fe70eabba1ca79 --- a/src/thread/pthread_setschedparam.c +++ b/src/thread/pthread_setschedparam.c @@ -1,3 +1,4 @@ +#include #include "pthread_impl.h" #include "lock.h" @@ -5,6 +6,7 @@ int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *par { int r; + unsupported_api(__FUNCTION__); if (policy != SCHED_RR && policy != SCHED_FIFO) { return EINVAL; } diff --git a/src/time/__tz.c b/src/time/__tz.c old mode 100644 new mode 100755 index 185642e8828bd00a24b622043f1e5117cb5eb94d..0ff172f9d05ce87c9b9baa7e08de30d18f4e2ebe --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -6,6 +6,7 @@ #include #include "libc.h" #include "lock.h" +#include long __timezone = 0; int __daylight = 0; @@ -402,6 +403,7 @@ dst: static void __tzset() { + unsupported_api(__FUNCTION__); LOCK(lock); do_tzset(); UNLOCK(lock); diff --git a/src/time/clock.c b/src/time/clock.c old mode 100644 new mode 100755 index 6724012b92ef69b8dfa19e087b940aaf6a141e10..06994710b4f79e4ec8275af8e6514f95ad017257 --- a/src/time/clock.c +++ b/src/time/clock.c @@ -1,10 +1,12 @@ #include #include +#include clock_t clock() { struct timespec ts; + unsupported_api(__FUNCTION__); if (__clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts)) return -1; diff --git a/src/time/clock_getcpuclockid.c b/src/time/clock_getcpuclockid.c old mode 100644 new mode 100755 index 8a0e2d4c3a622f9e8cf11c0cf7300eb1f59b9ea6..aa916f3d38d863c950b04d105f71eb6b2f44b599 --- a/src/time/clock_getcpuclockid.c +++ b/src/time/clock_getcpuclockid.c @@ -1,11 +1,14 @@ #include #include #include +#include #include "syscall.h" int clock_getcpuclockid(pid_t pid, clockid_t *clk) { struct timespec ts; + unsupported_api(__FUNCTION__); + clockid_t id = (-pid-1)*8U + 2; int ret = __syscall(SYS_clock_getres, id, &ts); if (ret) return -ret; diff --git a/src/time/utime.c b/src/time/utime.c old mode 100644 new mode 100755 index e7592b297809c817a2ec9ca4368be1f37147920b..36279de35ae266668b16666c55297cfa9662bc9a --- a/src/time/utime.c +++ b/src/time/utime.c @@ -2,9 +2,11 @@ #include #include #include +#include int utime(const char *path, const struct utimbuf *times) { + unsupported_api(__FUNCTION__); return utimensat(AT_FDCWD, path, times ? ((struct timespec [2]){ { .tv_sec = times->actime }, { .tv_sec = times->modtime }}) : 0, 0); diff --git a/src/unistd/ctermid.c b/src/unistd/ctermid.c old mode 100644 new mode 100755 index 1612770af158ce068e2b9a1ecc89c4d910d76edd..dc30487f740a54e76ada54ba85dd912fae75375c --- a/src/unistd/ctermid.c +++ b/src/unistd/ctermid.c @@ -1,7 +1,9 @@ #include #include +#include char *ctermid(char *s) { + unsupported_api(__FUNCTION__); return s ? strcpy(s, "/dev/tty") : "/dev/tty"; } diff --git a/src/unistd/dup.c b/src/unistd/dup.c old mode 100644 new mode 100755 index 7fee01201b82709a3cd0b04b3a457a846243d1a8..50731162f5af38d87e93eb3acf293037536fdb3a --- a/src/unistd/dup.c +++ b/src/unistd/dup.c @@ -1,7 +1,9 @@ #include #include "syscall.h" +#include int dup(int fd) { + unsupported_api(__FUNCTION__); return syscall(SYS_dup, fd); } diff --git a/src/unistd/faccessat.c b/src/unistd/faccessat.c old mode 100644 new mode 100755 index 76bbd4c72a16dbea7cdef397aa12ccb013adaa85..29e24e03ab28a6adb4d02d251845e78b9710668d --- a/src/unistd/faccessat.c +++ b/src/unistd/faccessat.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "syscall.h" #include "pthread_impl.h" @@ -25,6 +26,7 @@ static int checker(void *p) int faccessat(int fd, const char *filename, int amode, int flag) { + unsupported_api(__FUNCTION__); if (!flag || (flag==AT_EACCESS && getuid()==geteuid() && getgid()==getegid())) return syscall(SYS_faccessat, fd, filename, amode, flag); diff --git a/src/unistd/fchdir.c b/src/unistd/fchdir.c old mode 100644 new mode 100755 index dee45ba68e6425a17fe2ef4f4b77038666e43d80..54f9eb2328560b1194d52255faf713b5e549940e --- a/src/unistd/fchdir.c +++ b/src/unistd/fchdir.c @@ -1,10 +1,13 @@ #include #include #include +#include + #include "syscall.h" int fchdir(int fd) { + unsupported_api(__FUNCTION__); int ret = __syscall(SYS_fchdir, fd); if (ret != -EBADF || __syscall(SYS_fcntl, fd, F_GETFD) < 0) return __syscall_ret(ret); diff --git a/src/unistd/fchown.c b/src/unistd/fchown.c old mode 100644 new mode 100755 index 737b3672fcce506ec079ca819b2e91bd9eb872a9..441e39cb4d681d387f5bb0470f1882f726cb0692 --- a/src/unistd/fchown.c +++ b/src/unistd/fchown.c @@ -1,10 +1,13 @@ #include #include #include +#include + #include "syscall.h" int fchown(int fd, uid_t uid, gid_t gid) { + unsupported_api(__FUNCTION__); int ret = __syscall(SYS_fchown, fd, uid, gid); if (ret != -EBADF || __syscall(SYS_fcntl, fd, F_GETFD) < 0) return __syscall_ret(ret); diff --git a/src/unistd/fchownat.c b/src/unistd/fchownat.c old mode 100644 new mode 100755 index 62457a3ec0eb794d63043f8dc8be0e32415347b7..88fce2c187b84c67ef14808b4535146de1d8142b --- a/src/unistd/fchownat.c +++ b/src/unistd/fchownat.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" int fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag) { + unsupported_api(__FUNCTION__); return syscall(SYS_fchownat, fd, path, uid, gid, flag); } diff --git a/src/unistd/fdatasync.c b/src/unistd/fdatasync.c old mode 100644 new mode 100755 index 3895ae530c75de20300c2c5c8961c99d30befb1d..ee88d08da178149b5fd65b31f5afeda8b33711d8 --- a/src/unistd/fdatasync.c +++ b/src/unistd/fdatasync.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" int fdatasync(int fd) { + unsupported_api(__FUNCTION__); return syscall_cp(SYS_fdatasync, fd); } diff --git a/src/unistd/gethostname.c b/src/unistd/gethostname.c old mode 100644 new mode 100755 index 633ef571a4011332e2b47fc14a1841e398cc792a..91eecdf7a251091cf1507511337dba194093f6b7 --- a/src/unistd/gethostname.c +++ b/src/unistd/gethostname.c @@ -1,10 +1,12 @@ #include #include +#include int gethostname(char *name, size_t len) { size_t i; struct utsname uts; + unsupported_api(__FUNCTION__); if (uname(&uts)) return -1; if (len > sizeof uts.nodename) len = sizeof uts.nodename; for (i=0; i #include +#include char *getlogin(void) { + unsupported_api(__FUNCTION__); return getenv("LOGNAME"); } diff --git a/src/unistd/getlogin_r.c b/src/unistd/getlogin_r.c old mode 100644 new mode 100755 index 53866c6dce4077d8a53ba118a6460c2f2e6f55ee..41bd656efc3786d6603c16eda802b97b0d48591e --- a/src/unistd/getlogin_r.c +++ b/src/unistd/getlogin_r.c @@ -1,10 +1,12 @@ #include #include #include +#include int getlogin_r(char *name, size_t size) { char *logname = getlogin(); + unsupported_api(__FUNCTION__); if (!logname) return ENXIO; /* or...? */ if (strlen(logname) >= size) return ERANGE; strcpy(name, logname); diff --git a/src/unistd/getsid.c b/src/unistd/getsid.c old mode 100644 new mode 100755 index 93ba690e7ec22dde72bcd902924ae89dfb359306..ecb02e0b0259ef788331409c001aef380616d613 --- a/src/unistd/getsid.c +++ b/src/unistd/getsid.c @@ -1,7 +1,9 @@ #include #include "syscall.h" +#include pid_t getsid(pid_t pid) { + unsupported_api(__FUNCTION__); return syscall(SYS_getsid, pid); } diff --git a/src/unistd/lchown.c b/src/unistd/lchown.c old mode 100644 new mode 100755 index ccd5ee0255eea2af0dcec6f134e21ce07a896faf..e155ee02d52248ac89de6da648b7b39b0c7036bc --- a/src/unistd/lchown.c +++ b/src/unistd/lchown.c @@ -1,9 +1,11 @@ #include #include #include "syscall.h" +#include int lchown(const char *path, uid_t uid, gid_t gid) { + unsupported_api(__FUNCTION__); #ifdef SYS_lchown return syscall(SYS_lchown, path, uid, gid); #else diff --git a/src/unistd/link.c b/src/unistd/link.c old mode 100644 new mode 100755 index feec18e533d9595a2f37dd7fc8005b37c79b60ed..184b66806c121309e0262367e79f1aefe7b4c78d --- a/src/unistd/link.c +++ b/src/unistd/link.c @@ -1,9 +1,11 @@ #include #include #include "syscall.h" +#include int link(const char *existing, const char *new) { + unsupported_api(__FUNCTION__); #ifdef SYS_link return syscall(SYS_link, existing, new); #else diff --git a/src/unistd/linkat.c b/src/unistd/linkat.c old mode 100644 new mode 100755 index 6a9a0b77591a2273ad99d46cd228ead6a60b73f6..595df5b6fcd5de2da94a170a17e5e1572ae5209c --- a/src/unistd/linkat.c +++ b/src/unistd/linkat.c @@ -1,7 +1,9 @@ #include #include "syscall.h" +#include int linkat(int fd1, const char *existing, int fd2, const char *new, int flag) { + unsupported_api(__FUNCTION__); return syscall(SYS_linkat, fd1, existing, fd2, new, flag); } diff --git a/src/unistd/nice.c b/src/unistd/nice.c old mode 100644 new mode 100755 index 6c25c8c326a72f26ad6d8a5359f85dc669d59d1f..ec55a1375d0129725d53395aa60edc8decc2c534 --- a/src/unistd/nice.c +++ b/src/unistd/nice.c @@ -2,10 +2,12 @@ #include #include #include "syscall.h" +#include int nice(int inc) { int prio = inc; + unsupported_api(__FUNCTION__); // Only query old priority if it can affect the result. // This also avoids issues with integer overflow. if (inc > -2*NZERO && inc < 2*NZERO) diff --git a/src/unistd/pipe2.c b/src/unistd/pipe2.c old mode 100644 new mode 100755 index f24f74fb0300d0d1cfe40e93d1da24b63be081f4..2125dd32256fb1ab39c7b3c479911c97234d6ddf --- a/src/unistd/pipe2.c +++ b/src/unistd/pipe2.c @@ -1,11 +1,13 @@ #include #include #include +#include #include "syscall.h" int pipe2(int fd[2], int flag) { if (!flag) return pipe(fd); + unsupported_api(__FUNCTION__); int ret = __syscall(SYS_pipe2, fd, flag); if (ret != -ENOSYS) return __syscall_ret(ret); ret = pipe(fd); diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c old mode 100644 new mode 100755 index a152d52492ed775d3d8fd57125423e461bfb20d8..4d7c456dec5222d2452f6ef7afbf73e8014a018c --- a/src/unistd/readlink.c +++ b/src/unistd/readlink.c @@ -1,9 +1,11 @@ +#include #include #include #include "syscall.h" ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize) { + unsupported_api(__FUNCTION__); #ifdef SYS_readlink return syscall(SYS_readlink, path, buf, bufsize); #else diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c old mode 100644 new mode 100755 index 9af45cd5a47d1e23c673806704a2cf07d75d948f..c7bbefd0aa9c0237b96f6184fd6dec267b6fc772 --- a/src/unistd/readlinkat.c +++ b/src/unistd/readlinkat.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize) { + unsupported_api(__FUNCTION__); return syscall(SYS_readlinkat, fd, path, buf, bufsize); } diff --git a/src/unistd/renameat.c b/src/unistd/renameat.c old mode 100644 new mode 100755 index c3b40a258b2822214ce05a0cf1788d9af6298067..77d5d9a439e66e0fa9ca263228bc8b2a145b2ecc --- a/src/unistd/renameat.c +++ b/src/unistd/renameat.c @@ -1,8 +1,11 @@ #include +#include + #include "syscall.h" int renameat(int oldfd, const char *old, int newfd, const char *new) { + unsupported_api(__FUNCTION__); #ifdef SYS_renameat return syscall(SYS_renameat, oldfd, old, newfd, new); #else diff --git a/src/unistd/setsid.c b/src/unistd/setsid.c old mode 100644 new mode 100755 index 609bbe4ace41f02a55cea3e7eda48b3a4487b848..54e4d93479867c13674b6e3d8a75ee1fa677595a --- a/src/unistd/setsid.c +++ b/src/unistd/setsid.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" pid_t setsid(void) { + unsupported_api(__FUNCTION__); return syscall(SYS_setsid); } diff --git a/src/unistd/symlink.c b/src/unistd/symlink.c old mode 100644 new mode 100755 index 0973d78a8936bca2cef633f361abd2401bd82f4a..4b9294fb4076c676cd9c4b51e996df21ac763e9e --- a/src/unistd/symlink.c +++ b/src/unistd/symlink.c @@ -1,9 +1,12 @@ #include #include +#include + #include "syscall.h" int symlink(const char *existing, const char *new) { + unsupported_api(__FUNCTION__); #ifdef SYS_symlink return syscall(SYS_symlink, existing, new); #else diff --git a/src/unistd/symlinkat.c b/src/unistd/symlinkat.c old mode 100644 new mode 100755 index d1c59b4db0991d18e2d15895709d72c636f09556..f2f7eb780e1161164083b44036cc89f16050303f --- a/src/unistd/symlinkat.c +++ b/src/unistd/symlinkat.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" int symlinkat(const char *existing, int fd, const char *new) { + unsupported_api(__FUNCTION__); return syscall(SYS_symlinkat, existing, fd, new); } diff --git a/src/unistd/sync.c b/src/unistd/sync.c old mode 100644 new mode 100755 index f18765aa85063b6052ae6d6ffd625cfac617e705..666aaf7d79ecde2888c414abe0b7702936a4d0c9 --- a/src/unistd/sync.c +++ b/src/unistd/sync.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" void sync(void) { + unsupported_api(__FUNCTION__); __syscall(SYS_sync); } diff --git a/src/unistd/tcgetpgrp.c b/src/unistd/tcgetpgrp.c old mode 100644 new mode 100755 index 50080c7e8e791e2b44174c5c166850a00be8af2f..5fc8ae2737b6b98f46527a8364b46ae29df23fee --- a/src/unistd/tcgetpgrp.c +++ b/src/unistd/tcgetpgrp.c @@ -1,10 +1,12 @@ #include #include #include +#include pid_t tcgetpgrp(int fd) { int pgrp; + unsupported_api(__FUNCTION__); if (ioctl(fd, TIOCGPGRP, &pgrp) < 0) return -1; return pgrp; diff --git a/src/unistd/ttyname.c b/src/unistd/ttyname.c old mode 100644 new mode 100755 index 0f3e11411b068ec820b5e4212ba57d9dd6b59e54..31f3dc1894e28e2f0fd6b01ad8fbe3e1f1737c84 --- a/src/unistd/ttyname.c +++ b/src/unistd/ttyname.c @@ -1,11 +1,13 @@ #include #include #include +#include char *ttyname(int fd) { static char buf[TTY_NAME_MAX]; int result; + unsupported_api(__FUNCTION__); if ((result = ttyname_r(fd, buf, sizeof buf))) { errno = result; return NULL; diff --git a/src/unistd/unlinkat.c b/src/unistd/unlinkat.c old mode 100644 new mode 100755 index e0e25d22a30c47efc6e98df9f2d4c89953039919..96ba4069c228325fb691217e148880a946ff3523 --- a/src/unistd/unlinkat.c +++ b/src/unistd/unlinkat.c @@ -1,7 +1,10 @@ #include +#include + #include "syscall.h" int unlinkat(int fd, const char *path, int flag) { + unsupported_api(__FUNCTION__); return syscall(SYS_unlinkat, fd, path, flag); }