head 1.35; access; symbols PTH_2_0_7:1.34 PTH_2_0_6:1.33 PTH_2_0_5:1.33 PTH_2_0_4:1.33 PTH_2_0_3:1.32 PTH_2_0_2:1.32 PTH_2_0_1:1.30 PTH_2_0_0:1.29 PTH_2_0b2:1.28 PTH_2_0b1:1.28 PTH_2_0b0:1.27 PTH_1_4:1.22.0.2 PTH_1_4_1:1.22 PTH_1_4_0:1.21 PTH_1_3_7:1.17 PTH_1_4a3:1.19 PTH_1_3_6:1.17 PTH_1_4a2:1.19 PTH_1_3_5:1.17 PTH_1_4a1:1.19 PTH_1_3_4:1.17 PTH_1_3:1.17.0.2 PTH_1_3_3:1.17 PTH_1_3_2:1.17 PTH_1_3_1:1.17 PTH_1_3_0:1.17 PTH_1_3b3:1.17 PTH_1_2_3:1.12.2.2 PTH_1_3b2:1.17 PTH_1_3b1:1.16 PTH_1_3a5:1.15 PTH_1_3a4:1.15 PTH_1_3a3:1.15 PTH_1_2_2:1.12.2.1 PTH_1_3a2:1.15 PTH_1_2_1:1.12.2.1 PTH_1_3a1:1.13 PTH_1_2:1.12.0.2 PTH_1_2_0:1.12 PTH_1_2b8:1.11 PTH_1_2b7:1.11 PTH_1_1_6:1.7 PTH_1_2b6:1.10 PTH_1_2b5:1.10 PTH_1_2b4:1.10 PTH_1_2b3:1.10 PTH_1_2b2:1.9 PTH_1_2b1:1.9 PTH_1_1_5:1.7 PTH_1_0_6:1.6 PTH_1_0_5:1.6 PTH_1_0:1.6.0.2 PTH_1_1:1.7.0.2 PTH_1_1_4:1.7 PTH_1_1_3:1.7 PTH_1_1_2:1.7 PTH_1_1_1:1.7 PTH_1_1_0:1.7 PTH_1_1b7:1.6 PTH_1_1b6:1.6 PTH_1_1b5:1.6 PTH_1_1b4:1.6 PTH_1_1b3:1.6 PTH_1_1b2:1.6 PTH_1_1b1:1.6 PTH_1_0_4:1.6 PTH_1_0_3:1.6 PTH_1_0_2:1.6 PTH_1_0_1:1.6 PTH_1_0_0:1.4 PTH_1_0b8:1.3 PTH_1_0b7:1.2 PTH_1_0b6:1.2 PTH_1_0b5:1.2; locks; strict; comment @ * @; 1.35 date 2007.01.01.18.23.53; author rse; state Exp; branches; next 1.34; commitid 9DhdiirNzQPBIP0s; 1.34 date 2006.06.08.17.54.53; author rse; state Exp; branches; next 1.33; commitid x8N3mLVdQgkbdeAr; 1.33 date 2004.12.31.19.34.45; author rse; state Exp; branches; next 1.32; 1.32 date 2004.09.12.12.33.03; author rse; state Exp; branches; next 1.31; 1.31 date 2004.09.12.12.02.50; author rse; state Exp; branches; next 1.30; 1.30 date 2004.07.13.10.50.49; author rse; state Exp; branches; next 1.29; 1.29 date 2003.01.01.15.49.12; author rse; state Exp; branches; next 1.28; 1.28 date 2002.11.08.16.05.55; author rse; state Exp; branches; next 1.27; 1.27 date 2002.11.03.16.53.27; author rse; state Exp; branches; next 1.26; 1.26 date 2002.10.25.11.56.16; author rse; state Exp; branches; next 1.25; 1.25 date 2002.10.20.16.22.03; author rse; state Exp; branches; next 1.24; 1.24 date 2002.10.20.12.12.21; author rse; state Exp; branches; next 1.23; 1.23 date 2002.10.20.11.45.10; author rse; state Exp; branches; next 1.22; 1.22 date 2002.01.27.11.03.41; author rse; state Exp; branches; next 1.21; 1.21 date 2001.03.24.14.51.05; author rse; state Exp; branches; next 1.20; 1.20 date 2000.10.03.09.26.47; author rse; state Exp; branches; next 1.19; 1.19 date 2000.03.23.14.28.38; author rse; state Exp; branches; next 1.18; 1.18 date 2000.03.12.19.13.43; author rse; state Exp; branches; next 1.17; 1.17 date 2000.01.26.16.56.17; author rse; state Exp; branches; next 1.16; 1.16 date 2000.01.24.15.02.37; author rse; state Exp; branches; next 1.15; 1.15 date 99.12.30.21.59.01; author rse; state Exp; branches; next 1.14; 1.14 date 99.11.09.08.11.32; author rse; state Exp; branches; next 1.13; 1.13 date 99.11.01.10.27.20; author rse; state Exp; branches; next 1.12; 1.12 date 99.10.31.11.46.13; author rse; state Exp; branches 1.12.2.1; next 1.11; 1.11 date 99.10.19.14.40.25; author rse; state Exp; branches; next 1.10; 1.10 date 99.09.17.08.01.55; author rse; state Exp; branches; next 1.9; 1.9 date 99.09.02.10.12.46; author rse; state Exp; branches; next 1.8; 1.8 date 99.09.01.08.51.24; author rse; state Exp; branches; next 1.7; 1.7 date 99.08.19.15.08.53; author rse; state Exp; branches; next 1.6; 1.6 date 99.07.22.15.47.20; author rse; state Exp; branches; next 1.5; 1.5 date 99.07.22.14.55.10; author rse; state Exp; branches; next 1.4; 1.4 date 99.07.16.11.40.11; author rse; state Exp; branches; next 1.3; 1.3 date 99.07.15.15.27.58; author rse; state Exp; branches; next 1.2; 1.2 date 99.07.10.15.14.47; author rse; state Exp; branches; next 1.1; 1.1 date 99.07.10.14.21.17; author rse; state Exp; branches; next ; 1.12.2.1 date 99.11.01.10.25.01; author rse; state Exp; branches; next 1.12.2.2; 1.12.2.2 date 2000.02.04.22.07.18; author rse; state Exp; branches; next ; desc @@ 1.35 log @Adjusted all copyright messages for new year 2007. @ text @/* ** GNU Pth - The GNU Portable Threads ** Copyright (c) 1999-2007 Ralf S. Engelschall ** ** This file is part of GNU Pth, a non-preemptive thread scheduling ** library which can be found at http://www.gnu.org/software/pth/. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA, or contact Ralf S. Engelschall . ** ** pth_syscall.c: Pth direct syscall support */ /* ``Free Software: generous programmers from around the world all join forces to help you shoot yourself in the foot for free.'' -- Unknown */ /* * Prevent system includes from declaring the syscalls in order to avoid * prototype mismatches. In theory those mismatches should not happen * at all, but slight (but still compatible) differences (ssize_t vs. * size_t, etc) can lead to a compile-time failure (although run-time * would be ok). Hence protect ourself from this situation. */ #define fork __pth_sys_fork #define waitpid __pth_sys_waitpid #define system __pth_sys_system #define nanosleep __pth_sys_nanosleep #define usleep __pth_sys_usleep #define sleep __pth_sys_sleep #define sigprocmask __pth_sys_sigmask #define sigwait __pth_sys_sigwait #define select __pth_sys_select #define pselect __pth_sys_pselect #define poll __pth_sys_poll #define connect __pth_sys_connect #define accept __pth_sys_accept #define read __pth_sys_read #define write __pth_sys_write #define readv __pth_sys_readv #define writev __pth_sys_writev #define recv __pth_sys_recv #define send __pth_sys_send #define recvfrom __pth_sys_recvfrom #define sendto __pth_sys_sendto #define pread __pth_sys_pread #define pwrite __pth_sys_pwrite /* include the private header and this way system headers */ #include "pth_p.h" /* some exported variables for object layer checks */ int pth_syscall_soft = PTH_SYSCALL_SOFT; int pth_syscall_hard = PTH_SYSCALL_HARD; #if cpp #if PTH_SYSCALL_HARD /* hard syscall mapping */ #if HAVE_SYS_SYSCALL_H #include #endif #ifdef HAVE_SYS_SOCKETCALL_H #include #endif #define pth_sc(func) pth_sc_##func #else /* !PTH_SYSCALL_HARD */ /* no hard syscall mapping */ #define pth_sc(func) func #endif /* PTH_SYSCALL_HARD */ #endif /* cpp */ /* * Unprotect us from the namespace conflict with the * syscall prototypes in system headers. */ #undef fork #undef waitpid #undef system #undef nanosleep #undef usleep #undef sleep #undef sigprocmask #undef sigwait #undef select #undef pselect #undef poll #undef connect #undef accept #undef read #undef write #undef readv #undef writev #undef recv #undef send #undef recvfrom #undef sendto #undef pread #undef pwrite /* internal data structures */ #if cpp typedef int (*pth_syscall_fct_t)(); typedef struct { char *name; /* name of system/function call */ pth_syscall_fct_t addr; /* address of wrapped system/function call */ } pth_syscall_fct_tab_t; typedef struct { char *path; /* path to dynamic library */ void *handle; /* handle of dynamic library */ } pth_syscall_lib_tab_t; #endif #if PTH_SYSCALL_HARD /* NUL-spiked copy of library paths */ static char *pth_syscall_libs = NULL; /* table of dynamic libraries and their resolving handles */ static pth_syscall_lib_tab_t pth_syscall_lib_tab[128] = { { NULL, NULL } }; /* table of syscalls and their resolved function pointers */ intern pth_syscall_fct_tab_t pth_syscall_fct_tab[] = { /* Notice: order must match the macro values above */ #define PTH_SCF_fork 0 #define PTH_SCF_waitpid 1 #define PTH_SCF_system 2 #define PTH_SCF_nanosleep 3 #define PTH_SCF_usleep 4 #define PTH_SCF_sleep 5 #define PTH_SCF_sigprocmask 6 #define PTH_SCF_sigwait 7 #define PTH_SCF_select 8 #define PTH_SCF_poll 9 #define PTH_SCF_connect 10 #define PTH_SCF_accept 11 #define PTH_SCF_read 12 #define PTH_SCF_write 13 #define PTH_SCF_readv 14 #define PTH_SCF_writev 15 #define PTH_SCF_recv 16 #define PTH_SCF_send 17 #define PTH_SCF_recvfrom 18 #define PTH_SCF_sendto 19 #define PTH_SCF_pread 20 #define PTH_SCF_pwrite 21 { "fork", NULL }, { "waitpid", NULL }, { "system", NULL }, { "nanosleep", NULL }, { "usleep", NULL }, { "sleep", NULL }, { "sigprocmask", NULL }, { "sigwait", NULL }, { "select", NULL }, { "poll", NULL }, { "connect", NULL }, { "accept", NULL }, { "read", NULL }, { "write", NULL }, { "readv", NULL }, { "writev", NULL }, { "recv", NULL }, { "send", NULL }, { "recvfrom", NULL }, { "sendto", NULL }, { "pread", NULL }, { "pwrite", NULL }, { NULL, NULL } }; #endif /* syscall wrapping initialization */ intern void pth_syscall_init(void) { #if PTH_SYSCALL_HARD int i; int j; char *cpLib; char *cp; /* fill paths of libraries into internal table */ pth_syscall_libs = strdup(PTH_SYSCALL_LIBS); cpLib = pth_syscall_libs; for (i = 0; i < (sizeof(pth_syscall_lib_tab)/sizeof(pth_syscall_lib_tab_t))-1; ) { if ((cp = strchr(cpLib, ':')) != NULL) *cp++ = '\0'; pth_syscall_lib_tab[i].path = cpLib; pth_syscall_lib_tab[i].handle = NULL; i++; if (cp != NULL) cpLib = cp; else break; } pth_syscall_lib_tab[i].path = NULL; #if defined(HAVE_DLOPEN) && defined(HAVE_DLSYM) /* determine addresses of syscall functions */ for (i = 0; pth_syscall_fct_tab[i].name != NULL; i++) { /* attempt #1: fetch from implicit successor libraries */ #if defined(HAVE_DLSYM) && defined(HAVE_RTLD_NEXT) pth_syscall_fct_tab[i].addr = (pth_syscall_fct_t) dlsym(RTLD_NEXT, pth_syscall_fct_tab[i].name); #endif /* attempt #2: fetch from explicitly loaded C library */ if (pth_syscall_fct_tab[i].addr == NULL) { /* first iteration: try resolve from already loaded libraries */ for (j = 0; pth_syscall_lib_tab[j].path != NULL; j++) { if (pth_syscall_lib_tab[j].handle != NULL) { pth_syscall_fct_tab[i].addr = (pth_syscall_fct_t) dlsym(pth_syscall_lib_tab[j].handle, pth_syscall_fct_tab[i].name); if (pth_syscall_fct_tab[i].addr != NULL) break; } } /* second iteration: try to load more libraries for resolving */ if (pth_syscall_fct_tab[i].addr == NULL) { for (j = 0; pth_syscall_lib_tab[j].path != NULL; j++) { if (pth_syscall_lib_tab[j].handle == NULL) { if ((pth_syscall_lib_tab[j].handle = dlopen(pth_syscall_lib_tab[j].path, RTLD_LAZY)) == NULL) continue; pth_syscall_fct_tab[i].addr = (pth_syscall_fct_t) dlsym(pth_syscall_lib_tab[j].handle, pth_syscall_fct_tab[i].name); if (pth_syscall_fct_tab[i].addr != NULL) break; } } } } } #endif #endif return; } /* syscall wrapping initialization */ intern void pth_syscall_kill(void) { #if PTH_SYSCALL_HARD int i; #if defined(HAVE_DLOPEN) && defined(HAVE_DLSYM) /* unload all explicitly loaded libraries */ for (i = 0; pth_syscall_lib_tab[i].path != NULL; i++) { if (pth_syscall_lib_tab[i].handle != NULL) { dlclose(pth_syscall_lib_tab[i].handle); pth_syscall_lib_tab[i].handle = NULL; } pth_syscall_lib_tab[i].path = NULL; } #endif free(pth_syscall_libs); pth_syscall_libs = NULL; #endif return; } #if PTH_SYSCALL_HARD /* utility macro for returning syscall errors */ #define PTH_SYSCALL_ERROR(return_val,errno_val,syscall) \ do { fprintf(stderr, \ "pth:WARNING: unable to perform syscall `%s': " \ "no implementation resolvable\n", syscall); \ errno = (errno_val); \ return (return_val); \ } while (0) /* ==== Pth hard syscall wrapper for fork(2) ==== */ pid_t fork(void); pid_t fork(void) { /* external entry point for application */ pth_implicit_init(); return pth_fork(); } intern pid_t pth_sc_fork(void) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_fork].addr != NULL) return ((pid_t (*)(void)) pth_syscall_fct_tab[PTH_SCF_fork].addr) (); #if defined(HAVE_SYSCALL) && defined(SYS_fork) else return (pid_t)syscall(SYS_fork); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "fork"); #endif } /* ==== Pth hard syscall wrapper for nanosleep(3) ==== */ int nanosleep(const struct timespec *, struct timespec *); int nanosleep(const struct timespec *rqtp, struct timespec *rmtp) { /* external entry point for application */ pth_implicit_init(); return pth_nanosleep(rqtp, rmtp); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_nanosleep necessary! */ /* ==== Pth hard syscall wrapper for usleep(3) ==== */ int usleep(unsigned int); int usleep(unsigned int sec) { /* external entry point for application */ pth_implicit_init(); return pth_usleep(sec); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_usleep necessary! */ /* ==== Pth hard syscall wrapper for sleep(3) ==== */ unsigned int sleep(unsigned int); unsigned int sleep(unsigned int sec) { /* external entry point for application */ pth_implicit_init(); return pth_sleep(sec); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_sleep necessary! */ /* ==== Pth hard syscall wrapper for system(3) ==== */ int system(const char *); int system(const char *cmd) { /* external entry point for application */ pth_implicit_init(); return pth_system(cmd); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_system necessary! */ /* ==== Pth hard syscall wrapper for sigprocmask(2) ==== */ int sigprocmask(int, const sigset_t *, sigset_t *); int sigprocmask(int how, const sigset_t *set, sigset_t *oset) { /* external entry point for application */ pth_implicit_init(); return pth_sigmask(how, set, oset); } intern int pth_sc_sigprocmask(int how, const sigset_t *set, sigset_t *oset) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_sigprocmask].addr != NULL) return ((int (*)(int, const sigset_t *, sigset_t *)) pth_syscall_fct_tab[PTH_SCF_sigprocmask].addr) (how, set, oset); #if defined(HAVE_SYSCALL) && defined(SYS___sigprocmask14) /* NetBSD */ else return (int)syscall(SYS___sigprocmask14, how, set, oset); #elif defined(HAVE_SYSCALL) && defined(SYS_sigprocmask) else return (int)syscall(SYS_sigprocmask, how, set, oset); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "sigprocmask"); #endif } /* ==== Pth hard syscall wrapper for sigwait(3) ==== */ int sigwait(const sigset_t *, int *); int sigwait(const sigset_t *set, int *sigp) { /* external entry point for application */ pth_implicit_init(); return pth_sigwait(set, sigp); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_sigwait necessary! */ /* ==== Pth hard syscall wrapper for waitpid(2) ==== */ pid_t waitpid(pid_t, int *, int); pid_t waitpid(pid_t wpid, int *status, int options) { /* external entry point for application */ pth_implicit_init(); return pth_waitpid(wpid, status, options); } intern pid_t pth_sc_waitpid(pid_t wpid, int *status, int options) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_waitpid].addr != NULL) return ((pid_t (*)(pid_t, int *, int)) pth_syscall_fct_tab[PTH_SCF_waitpid].addr) (wpid, status, options); #if defined(HAVE_SYSCALL) && defined(SYS_waitpid) else return (pid_t)syscall(SYS_waitpid, wpid, status, options); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "waitpid"); #endif } /* ==== Pth hard syscall wrapper for connect(2) ==== */ int connect(int, const struct sockaddr *, socklen_t); int connect(int s, const struct sockaddr *addr, socklen_t addrlen) { /* external entry point for application */ pth_implicit_init(); return pth_connect(s, addr, addrlen); } intern int pth_sc_connect(int s, const struct sockaddr *addr, socklen_t addrlen) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_connect].addr != NULL) return ((int (*)(int, const struct sockaddr *, socklen_t)) pth_syscall_fct_tab[PTH_SCF_connect].addr) (s, addr, addrlen); #if defined(HAVE_SYSCALL) && defined(SYS_connect) else return (int)syscall(SYS_connect, s, addr, addrlen); #elif defined(HAVE_SYSCALL) && defined(SYS_socketcall) && defined(SOCKOP_connect) /* Linux */ else { unsigned long args[3]; args[0] = (unsigned long)s; args[1] = (unsigned long)addr; args[2] = (unsigned long)addrlen; return (int)syscall(SYS_socketcall, SOCKOP_connect, args); } #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "connect"); #endif } /* ==== Pth hard syscall wrapper for accept(2) ==== */ int accept(int, struct sockaddr *, socklen_t *); int accept(int s, struct sockaddr *addr, socklen_t *addrlen) { /* external entry point for application */ pth_implicit_init(); return pth_accept(s, addr, addrlen); } intern int pth_sc_accept(int s, struct sockaddr *addr, socklen_t *addrlen) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_accept].addr != NULL) return ((int (*)(int, struct sockaddr *, socklen_t *)) pth_syscall_fct_tab[PTH_SCF_accept].addr) (s, addr, addrlen); #if defined(HAVE_SYSCALL) && defined(SYS_accept) else return (int)syscall(SYS_accept, s, addr, addrlen); #elif defined(HAVE_SYSCALL) && defined(SYS_socketcall) && defined(SOCKOP_accept) /* Linux */ else { unsigned long args[3]; args[0] = (unsigned long)s; args[1] = (unsigned long)addr; args[2] = (unsigned long)addrlen; return (int)syscall(SYS_socketcall, SOCKOP_accept, args); } #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "accept"); #endif } /* ==== Pth hard syscall wrapper for select(2) ==== */ int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { /* external entry point for application */ pth_implicit_init(); return pth_select(nfds, readfds, writefds, exceptfds, timeout); } intern int pth_sc_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_select].addr != NULL) return ((int (*)(int, fd_set *, fd_set *, fd_set *, struct timeval *)) pth_syscall_fct_tab[PTH_SCF_select].addr) (nfds, readfds, writefds, exceptfds, timeout); #if defined(HAVE_SYSCALL) && defined(SYS__newselect) /* Linux */ else return (int)syscall(SYS__newselect, nfds, readfds, writefds, exceptfds, timeout); #elif defined(HAVE_SYSCALL) && defined(SYS_select) else return (int)syscall(SYS_select, nfds, readfds, writefds, exceptfds, timeout); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "accept"); #endif } /* ==== Pth hard syscall wrapper for pselect(2) ==== */ int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); int pselect(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, const struct timespec *ts, const sigset_t *mask) { /* external entry point for application */ pth_implicit_init(); return pth_pselect(nfds, rfds, wfds, efds, ts, mask); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_pselect necessary! */ /* ==== Pth hard syscall wrapper for poll(2) ==== */ int poll(struct pollfd *, nfds_t, int); int poll(struct pollfd *pfd, nfds_t nfd, int timeout) { /* external entry point for application */ pth_implicit_init(); return pth_poll(pfd, nfd, timeout); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_poll necessary! */ /* ==== Pth hard syscall wrapper for read(2) ==== */ ssize_t read(int, void *, size_t); ssize_t read(int fd, void *buf, size_t nbytes) { /* external entry point for application */ pth_implicit_init(); return pth_read(fd, buf, nbytes); } intern ssize_t pth_sc_read(int fd, void *buf, size_t nbytes) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_read].addr != NULL) return ((ssize_t (*)(int, void *, size_t)) pth_syscall_fct_tab[PTH_SCF_read].addr) (fd, buf, nbytes); #if defined(HAVE_SYSCALL) && defined(SYS_read) else return (ssize_t)syscall(SYS_read, fd, buf, nbytes); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "read"); #endif } /* ==== Pth hard syscall wrapper for write(2) ==== */ ssize_t write(int, const void *, size_t); ssize_t write(int fd, const void *buf, size_t nbytes) { /* external entry point for application */ pth_implicit_init(); return pth_write(fd, buf, nbytes); } intern ssize_t pth_sc_write(int fd, const void *buf, size_t nbytes) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_write].addr != NULL) return ((ssize_t (*)(int, const void *, size_t)) pth_syscall_fct_tab[PTH_SCF_write].addr) (fd, buf, nbytes); #if defined(HAVE_SYSCALL) && defined(SYS_write) else return (ssize_t)syscall(SYS_write, fd, buf, nbytes); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "write"); #endif } /* ==== Pth hard syscall wrapper for readv(2) ==== */ ssize_t readv(int, const struct iovec *, int); ssize_t readv(int fd, const struct iovec *iov, int iovcnt) { /* external entry point for application */ pth_implicit_init(); return pth_readv(fd, iov, iovcnt); } intern ssize_t pth_sc_readv(int fd, const struct iovec *iov, int iovcnt) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_readv].addr != NULL) return ((ssize_t (*)(int, const struct iovec *, int)) pth_syscall_fct_tab[PTH_SCF_readv].addr) (fd, iov, iovcnt); #if defined(HAVE_SYSCALL) && defined(SYS_readv) else return (ssize_t)syscall(SYS_readv, fd, iov, iovcnt); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "readv"); #endif } /* ==== Pth hard syscall wrapper for writev(2) ==== */ ssize_t writev(int, const struct iovec *, int); ssize_t writev(int fd, const struct iovec *iov, int iovcnt) { /* external entry point for application */ pth_implicit_init(); return pth_writev(fd, iov, iovcnt); } intern ssize_t pth_sc_writev(int fd, const struct iovec *iov, int iovcnt) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_writev].addr != NULL) return ((ssize_t (*)(int, const struct iovec *, int)) pth_syscall_fct_tab[PTH_SCF_writev].addr) (fd, iov, iovcnt); #if defined(HAVE_SYSCALL) && defined(SYS_writev) else return (ssize_t)syscall(SYS_writev, fd, iov, iovcnt); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "writev"); #endif } /* ==== Pth hard syscall wrapper for pread(2) ==== */ ssize_t pread(int, void *, size_t, off_t); ssize_t pread(int fd, void *buf, size_t nbytes, off_t offset) { /* external entry point for application */ pth_implicit_init(); return pth_pread(fd, buf, nbytes, offset); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_pread necessary! */ /* ==== Pth hard syscall wrapper for pwrite(2) ==== */ ssize_t pwrite(int, const void *, size_t, off_t); ssize_t pwrite(int fd, const void *buf, size_t nbytes, off_t offset) { /* external entry point for application */ pth_implicit_init(); return pth_pwrite(fd, buf, nbytes, offset); } /* NOTICE: internally fully emulated, so still no internal exit point pth_sc_pwrite necessary! */ /* ==== Pth hard syscall wrapper for recv(2) ==== */ ssize_t recv(int, void *, size_t, int); ssize_t recv(int fd, void *buf, size_t nbytes, int flags) { /* external entry point for application */ pth_implicit_init(); return pth_recv(fd, buf, nbytes, flags); } intern ssize_t pth_sc_recv(int fd, void *buf, size_t nbytes, int flags) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_recv].addr != NULL) return ((ssize_t (*)(int, void *, size_t, int)) pth_syscall_fct_tab[PTH_SCF_recv].addr) (fd, buf, nbytes, flags); #if defined(HAVE_SYSCALL) && defined(SYS_recv) else return (ssize_t)syscall(SYS_recv, fd, buf, nbytes, flags); #elif defined(HAVE_SYSCALL) && defined(SYS_recvfrom) else return (ssize_t)syscall(SYS_recvfrom, fd, buf, nbytes, flags, (struct sockaddr *)NULL, (socklen_t *)NULL); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "recv"); #endif } /* ==== Pth hard syscall wrapper for send(2) ==== */ ssize_t send(int, void *, size_t, int); ssize_t send(int fd, void *buf, size_t nbytes, int flags) { /* external entry point for application */ pth_implicit_init(); return pth_send(fd, buf, nbytes, flags); } intern ssize_t pth_sc_send(int fd, void *buf, size_t nbytes, int flags) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_send].addr != NULL) return ((ssize_t (*)(int, void *, size_t, int)) pth_syscall_fct_tab[PTH_SCF_send].addr) (fd, buf, nbytes, flags); #if defined(HAVE_SYSCALL) && defined(SYS_send) else return (ssize_t)syscall(SYS_send, fd, buf, nbytes, flags); #elif defined(HAVE_SYSCALL) && defined(SYS_sendto) else return (ssize_t)syscall(SYS_sendto, fd, buf, nbytes, flags, (struct sockaddr *)NULL, 0); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "send"); #endif } /* ==== Pth hard syscall wrapper for recvfrom(2) ==== */ ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); ssize_t recvfrom(int fd, void *buf, size_t nbytes, int flags, struct sockaddr *from, socklen_t *fromlen) { /* external entry point for application */ pth_implicit_init(); return pth_recvfrom(fd, buf, nbytes, flags, from, fromlen); } intern ssize_t pth_sc_recvfrom(int fd, void *buf, size_t nbytes, int flags, struct sockaddr *from, socklen_t *fromlen) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_recvfrom].addr != NULL) return ((ssize_t (*)(int, void *, size_t, int, struct sockaddr *, socklen_t *)) pth_syscall_fct_tab[PTH_SCF_recvfrom].addr) (fd, buf, nbytes, flags, from, fromlen); #if defined(HAVE_SYSCALL) && defined(SYS_recvfrom) else return (ssize_t)syscall(SYS_recvfrom, fd, buf, nbytes, flags, from, fromlen); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "recvfrom"); #endif } /* ==== Pth hard syscall wrapper for sendto(2) ==== */ ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); ssize_t sendto(int fd, const void *buf, size_t nbytes, int flags, const struct sockaddr *to, socklen_t tolen) { /* external entry point for application */ pth_implicit_init(); return pth_sendto(fd, buf, nbytes, flags, to, tolen); } intern ssize_t pth_sc_sendto(int fd, const void *buf, size_t nbytes, int flags, const struct sockaddr *to, socklen_t tolen) { /* internal exit point for Pth */ if (pth_syscall_fct_tab[PTH_SCF_sendto].addr != NULL) return ((ssize_t (*)(int, const void *, size_t, int, const struct sockaddr *, socklen_t)) pth_syscall_fct_tab[PTH_SCF_sendto].addr) (fd, buf, nbytes, flags, to, tolen); #if defined(HAVE_SYSCALL) && defined(SYS_sendto) else return (ssize_t)syscall(SYS_sendto, fd, buf, nbytes, flags, to, tolen); #else else PTH_SYSCALL_ERROR(-1, ENOSYS, "sendto"); #endif } #endif /* PTH_SYSCALL_HARD */ @ 1.34 log @Adjusted all copyright messages for new year 2006 @ text @d3 1 a3 1 ** Copyright (c) 1999-2006 Ralf S. Engelschall @ 1.33 log @Adjusted all copyright messages for new year 2005. @ text @d3 1 a3 1 ** Copyright (c) 1999-2005 Ralf S. Engelschall @ 1.32 log @Added hard syscall wrappers for send(2) and recv(2). Obtained from: NetBSD pkgsrc patches @ text @d3 1 a3 1 ** Copyright (c) 1999-2004 Ralf S. Engelschall @ 1.31 log @Fix syscall wrapper for sendto(2). Obtained from: NetBSD pkgsrc patches @ text @d632 48 @ 1.30 log @Adjusted all copyright messages for new year 2004. @ text @d667 1 a667 1 pth_syscall_fct_tab[PTH_SCF_recvfrom].addr) @ 1.29 log @Adjusted all copyright messages for new year 2003. @ text @d3 1 a3 1 ** Copyright (c) 1999-2003 Ralf S. Engelschall @ 1.28 log @Added soft and hard syscall mapping for nanosleep(3) and usleep(3) functions. @ text @d3 1 a3 1 ** Copyright (c) 1999-2002 Ralf S. Engelschall @ 1.27 log @Prevent system includes from declaring the syscalls in order to avoid prototype mismatches. In theory those mismatches should not happen at all, but slight (but still compatible) differences (ssize_t vs. size_t, etc) can lead to a compile-time failure (although run-time would be ok). Hence protect ourself from this situation. @ text @d40 2 d91 2 d141 19 a159 17 #define PTH_SCF_sleep 3 #define PTH_SCF_sigprocmask 4 #define PTH_SCF_sigwait 5 #define PTH_SCF_select 6 #define PTH_SCF_poll 7 #define PTH_SCF_connect 8 #define PTH_SCF_accept 9 #define PTH_SCF_read 10 #define PTH_SCF_write 11 #define PTH_SCF_readv 12 #define PTH_SCF_writev 13 #define PTH_SCF_recv 14 #define PTH_SCF_send 15 #define PTH_SCF_recvfrom 16 #define PTH_SCF_sendto 17 #define PTH_SCF_pread 18 #define PTH_SCF_pwrite 19 d163 2 d311 22 @ 1.26 log @Add a Pth variant of the new POSIX pselect(2) function, including soft and hard syscall mapping support for it. @ text @d30 30 d82 26 d283 1 d305 1 d316 1 d327 1 d351 1 d362 1 d384 1 d414 1 d444 1 d482 1 d493 1 d515 1 d537 1 d559 1 d603 1 d625 1 @ 1.25 log @Added "hard syscall mapping" support for using SYS___sigprocmask14 instead of SYS_sigprocmask on NetBSD. Submitted by: Nick Hudson @ text @d404 12 @ 1.24 log @ops, remove extra wrapper which breaks under --disable-syscall-hard @ text @d281 3 a283 1 #if defined(HAVE_SYSCALL) && defined(SYS_sigprocmask) d337 1 a337 1 #elif defined(HAVE_SYSCALL) && defined(SYS_socketcall) && defined(SOCKOP_connect) d366 1 a366 1 #elif defined(HAVE_SYSCALL) && defined(SYS_socketcall) && defined(SOCKOP_accept) d395 1 a395 1 #if defined(HAVE_SYSCALL) && defined(SYS__newselect) @ 1.23 log @Completely rewrote the "hard syscall mapping". Previously the internal syscall exit points were based on syscall(2) only. This is problematic because it by-passes the C library glue code which sometimes performs necessary assembly fiddling in order to call the underlying system calls correctly. Additionally, syscall(2) does not exists everywhere. Now the internal exit points are based on a by-syscall dynamically selected combination of RTLD_NEXT+dlsym(2), dlopen(2)+dlsym(2) and the known syscall(2) (in this fallback order). This way the "hard syscall mapping" is a lot more portable and flexible. Initial implementation by: Jonathan Schilling Enhanced implementation by: Ralf S. Engelschall @ text @a53 1 #if PTH_SYSCALL_HARD a62 1 #endif @ 1.22 log @bump copyright year @ text @d32 4 a36 1 d38 2 d41 1 d45 3 a47 2 #define pth_sc(func) PTH_SC_##func #else d49 16 d67 127 a193 1 #endif /* cpp */ d195 5 a199 3 /* some exported variables for object layer checks */ int pth_syscall_soft = PTH_SYSCALL_SOFT; int pth_syscall_hard = PTH_SYSCALL_HARD; d201 12 a212 6 /* Pth hard wrapper for syscall fork(2) */ #if cpp #if defined(SYS_fork) #define PTH_SC_fork() ((pid_t)syscall(SYS_fork)) #else #define PTH_SC_fork fork d214 15 a228 2 #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_fork) d231 1 d235 11 d247 1 d249 1 a249 2 /* Pth hard wrapper for sleep(3) [internally fully emulated] */ #if PTH_SYSCALL_HARD d252 1 d256 2 a257 1 #endif d259 1 a259 2 /* Pth hard wrapper for system(3) [internally fully emulated] */ #if PTH_SYSCALL_HARD d262 1 d266 2 a267 1 #endif d269 1 a269 9 /* Pth hard wrapper for sigprocmask(2) */ #if cpp #if defined(SYS_sigprocmask) #define PTH_SC_sigprocmask(a1,a2,a3) ((int)syscall(SYS_sigprocmask,(a1),(a2),(a3))) #else #define PTH_SC_sigprocmask sigprocmask #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_sigprocmask) d272 1 d276 11 d288 1 d290 1 a290 2 /* Pth hard wrapper for sigwait(3) [internally fully emulated] */ #if PTH_SYSCALL_HARD d293 1 d297 2 a298 1 #endif d300 1 a300 9 /* Pth hard wrapper for syscall waitpid(2) */ #if cpp #if defined(SYS_waitpid) #define PTH_SC_waitpid(a1,a2,a3) ((int)syscall(SYS_waitpid,(a1),(a2),(a3))) #else #define PTH_SC_waitpid waitpid #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_waitpid) d303 1 d307 11 a318 22 #if defined(SYS_socketcall) && defined(SOCKOP_connect) && defined(SOCKOP_accept) /* mainly Linux */ intern int _pth_socketcall(int call, ...) { va_list ap; unsigned long args[3]; va_start(ap, call); switch (call) { case SOCKOP_connect: args[0] = (unsigned long)va_arg(ap, int); args[1] = (unsigned long)va_arg(ap, struct sockaddr *); args[2] = (unsigned long)va_arg(ap, int); break; case SOCKOP_accept: args[0] = (unsigned long)va_arg(ap, int); args[1] = (unsigned long)va_arg(ap, struct sockaddr *); args[2] = (unsigned long)va_arg(ap, int *); break; } va_end(ap); return syscall(SYS_socketcall, call, args); a319 1 #endif d321 1 a321 12 /* Pth hard wrapper for syscall connect(2) */ #if cpp #if defined(SYS_connect) #define PTH_SC_connect(a1,a2,a3) ((int)syscall(SYS_connect,(a1),(a2),(a3))) #elif defined(SYS_socketcall) && defined(SOCKOP_connect) /* mainly Linux */ #define PTH_SC_connect(a1,a2,a3) ((int)_pth_socketcall(SOCKOP_connect,(a1),(a2),(a3))) #else #define PTH_SC_connect connect #endif #endif /* cpp */ #if PTH_SYSCALL_HARD &&\ (defined(SYS_connect) || (defined(SYS_socketcall) && defined(SOCKOP_connect))) d324 1 d328 19 d348 1 d350 1 a350 12 /* Pth hard wrapper for syscall accept(2) */ #if cpp #if defined(SYS_accept) #define PTH_SC_accept(a1,a2,a3) ((int)syscall(SYS_accept,(a1),(a2),(a3))) #elif defined(SYS_socketcall) && defined(SOCKOP_accept) /* mainly Linux */ #define PTH_SC_accept(a1,a2,a3) ((int)_pth_socketcall(SOCKOP_accept,(a1),(a2),(a3))) #else #define PTH_SC_accept accept #endif #endif /* cpp */ #if PTH_SYSCALL_HARD &&\ (defined(SYS_accept) || (defined(SYS_socketcall) && defined(SOCKOP_accept))) d353 1 d357 19 d377 1 d379 1 a379 11 /* Pth hard wrapper for syscall select(2) */ #if cpp #if defined(SYS__newselect) /* mainly Linux */ #define PTH_SC_select(a1,a2,a3,a4,a5) ((int)syscall(SYS__newselect,(a1),(a2),(a3),(a4),(a5))) #elif defined(SYS_select) #define PTH_SC_select(a1,a2,a3,a4,a5) ((int)syscall(SYS_select,(a1),(a2),(a3),(a4),(a5))) #else #define PTH_SC_select select #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && (defined(SYS__newselect) || defined(SYS_select)) d383 1 d387 14 d402 1 d404 1 a404 9 /* Pth hard wrapper for syscall poll(2) */ #if cpp #if defined(SYS_poll) #define PTH_SC_poll(a1,a2,a3) ((int)syscall(SYS_poll,(a1),(a2),(a3))) #else #define PTH_SC_poll poll #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_poll) d407 1 d411 2 a412 1 #endif d414 1 a414 9 /* Pth hard wrapper for syscall read(2) */ #if cpp #if defined(SYS_read) #define PTH_SC_read(a1,a2,a3) ((ssize_t)syscall(SYS_read,(a1),(a2),(a3))) #else #define PTH_SC_read read #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_read) d417 1 d421 11 d433 1 d435 1 a435 9 /* Pth hard wrapper for syscall write(2) */ #if cpp #if defined(SYS_write) #define PTH_SC_write(a1,a2,a3) ((ssize_t)syscall(SYS_write,(a1),(a2),(a3))) #else #define PTH_SC_write write #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_write) d438 1 d442 11 d454 1 d456 1 a456 9 /* Pth hard wrapper for syscall readv(2) */ #if cpp #if defined(SYS_readv) #define PTH_SC_readv(a1,a2,a3) ((ssize_t)syscall(SYS_readv,(a1),(a2),(a3))) #else #define PTH_SC_readv readv #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_readv) d459 1 d463 11 d475 1 d477 1 a477 9 /* Pth hard wrapper for syscall writev(2) */ #if cpp #if defined(SYS_writev) #define PTH_SC_writev(a1,a2,a3) ((ssize_t)syscall(SYS_writev,(a1),(a2),(a3))) #else #define PTH_SC_writev writev #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_writev) d480 1 d484 11 d496 1 d498 1 a498 2 /* Pth hard wrapper for pread(3) [internally fully emulated] */ #if PTH_SYSCALL_HARD d502 1 d506 2 a507 1 #endif d509 1 a509 2 /* Pth hard wrapper for pwrite(3) [internally fully emulated] */ #if PTH_SYSCALL_HARD d513 1 d517 2 a518 1 #endif d520 1 a520 9 /* Pth hard wrapper for syscall recvfrom(2) */ #if cpp #if defined(SYS_recvfrom) #define PTH_SC_recvfrom(a1,a2,a3,a4,a5,a6) ((ssize_t)syscall(SYS_recvfrom,(a1),(a2),(a3),(a4),(a5),(a6))) #else #define PTH_SC_recvfrom recvfrom #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_recvfrom) d523 1 d527 11 d539 1 d541 1 a541 9 /* Pth hard wrapper for syscall sendto(2) */ #if cpp #if defined(SYS_sendto) #define PTH_SC_sendto(a1,a2,a3,a4,a5,a6) ((ssize_t)syscall(SYS_sendto,(a1),(a2),(a3),(a4),(a5),(a6))) #else #define PTH_SC_sendto sendto #endif #endif /* cpp */ #if PTH_SYSCALL_HARD && defined(SYS_sendto) d544 1 d548 11 d560 3 @ 1.21 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.20 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.19 log @´´ @ text @d75 9 @ 1.18 log @*** empty log message *** @ text @d322 1 a322 1 ssize_t sendto(int fd, void *buf, size_t nbytes, int flags, struct sockaddr *to, socklen_t tolen) @ 1.17 log @*** empty log message *** @ text @d297 32 @ 1.16 log @*** empty log message *** @ text @d36 3 d116 24 d144 2 d150 3 a152 2 #if PTH_SYSCALL_HARD && defined(SYS_connect) int connect(int s, const struct sockaddr *addr, int addrlen) d163 2 d169 3 a171 2 #if PTH_SYSCALL_HARD && defined(SYS_accept) int accept(int s, struct sockaddr *addr, int *addrlen) @ 1.15 log @*** empty log message *** @ text @d147 3 a149 1 #if defined(SYS_select) d155 1 a155 1 #if PTH_SYSCALL_HARD && defined(SYS_select) @ 1.14 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999 Ralf S. Engelschall @ 1.13 log @*** empty log message *** @ text @d25 3 a27 3 /* ``Free Software: generous programmers from around the world all join forces to help you shoot yourself d154 1 a154 1 int select(int nfds, fd_set *readfds, fd_set *writefds, @ 1.12 log @*** empty log message *** @ text @d2 1 a2 2 ** pth_syscall.c -- Pth direct syscall support ** d22 2 @ 1.12.2.1 log @*** empty log message *** @ text @d2 2 a3 1 ** GNU Pth - The GNU Portable Threads a22 2 ** ** pth_syscall.c: Pth direct syscall support @ 1.12.2.2 log @*** empty log message *** @ text @a35 3 #ifdef HAVE_SYS_SOCKETCALL_H #include #endif a112 24 #if defined(SYS_socketcall) && defined(SOCKOP_connect) && defined(SOCKOP_accept) /* mainly Linux */ intern int _pth_socketcall(int call, ...) { va_list ap; unsigned long args[3]; va_start(ap, call); switch (call) { case SOCKOP_connect: args[0] = (unsigned long)va_arg(ap, int); args[1] = (unsigned long)va_arg(ap, struct sockaddr *); args[2] = (unsigned long)va_arg(ap, int); break; case SOCKOP_accept: args[0] = (unsigned long)va_arg(ap, int); args[1] = (unsigned long)va_arg(ap, struct sockaddr *); args[2] = (unsigned long)va_arg(ap, int *); break; } va_end(ap); return syscall(SYS_socketcall, call, args); } #endif a116 2 #elif defined(SYS_socketcall) && defined(SOCKOP_connect) /* mainly Linux */ #define PTH_SC_connect(a1,a2,a3) ((int)_pth_socketcall(SOCKOP_connect,(a1),(a2),(a3))) d121 2 a122 3 #if PTH_SYSCALL_HARD &&\ (defined(SYS_connect) || (defined(SYS_socketcall) && defined(SOCKOP_connect))) int connect(int s, const struct sockaddr *addr, socklen_t addrlen) a132 2 #elif defined(SYS_socketcall) && defined(SOCKOP_accept) /* mainly Linux */ #define PTH_SC_accept(a1,a2,a3) ((int)_pth_socketcall(SOCKOP_accept,(a1),(a2),(a3))) d137 2 a138 3 #if PTH_SYSCALL_HARD &&\ (defined(SYS_accept) || (defined(SYS_socketcall) && defined(SOCKOP_accept))) int accept(int s, struct sockaddr *addr, socklen_t *addrlen) d147 1 a147 3 #if defined(SYS__newselect) /* mainly Linux */ #define PTH_SC_select(a1,a2,a3,a4,a5) ((int)syscall(SYS__newselect,(a1),(a2),(a3),(a4),(a5))) #elif defined(SYS_select) d153 1 a153 1 #if PTH_SYSCALL_HARD && (defined(SYS__newselect) || defined(SYS_select)) @ 1.11 log @*** empty log message *** @ text @d12 1 a12 1 ** version 2 of the License, or (at your option) any later version. @ 1.10 log @*** empty log message *** @ text @d170 1 a170 1 int poll(struct pollfd *pfd, unsigned int nfd, int timeout) @ 1.9 log @*** empty log message *** @ text @d10 1 a10 1 ** modify it under the terms of the GNU Library General Public d17 1 a17 1 ** Library General Public License for more details. d19 1 a19 1 ** You should have received a copy of the GNU Library General Public @ 1.8 log @*** empty log message *** @ text @d74 1 a74 1 #define PTH_SC_sigprocmask() ((int)syscall(SYS_sigprocmask)) @ 1.7 log @*** empty log message *** @ text @d71 16 @ 1.6 log @*** empty log message *** @ text @d24 5 a28 1 @ 1.5 log @*** empty log message *** @ text @d223 2 a224 1 ssize_t pread(int fd, void *buf, size_t nbytes, off_t offset); d233 2 a234 1 ssize_t pwrite(int fd, const void *buf, size_t nbytes, off_t offset); @ 1.4 log @*** empty log message *** @ text @d189 50 @ 1.3 log @*** empty log message *** @ text @a57 11 /* Pth hard wrapper for usleep(3) [internally fully emulated] */ #if 0 /* usleep is bad standardized and can cause prototype conflict */ #if PTH_SYSCALL_HARD int usleep(unsigned int usec) { pth_implicit_init(); return pth_usleep(usec); } #endif #endif a67 1 #if 0 /* sigwait is bad standardized and can cause prototype conflict */ a73 1 #endif @ 1.2 log @*** empty log message *** @ text @d53 1 d63 1 d73 1 d83 1 d100 1 d116 1 d132 1 d149 1 d165 1 d181 1 d197 1 @ 1.1 log @*** empty log message *** @ text @d146 15 @