head 1.16; access; symbols PTH_2_0_7:1.15 PTH_2_0_6:1.14 PTH_2_0_5:1.14 PTH_2_0_4:1.14 PTH_2_0_3:1.13 PTH_2_0_2:1.13 PTH_2_0_1:1.13 PTH_2_0_0:1.12 PTH_2_0b2:1.11 PTH_2_0b1:1.11 PTH_2_0b0:1.11 PTH_1_4:1.10.0.2 PTH_1_4_1:1.10 PTH_1_4_0:1.9 PTH_1_3_7:1.8 PTH_1_4a3:1.8 PTH_1_3_6:1.8 PTH_1_4a2:1.8 PTH_1_3_5:1.8 PTH_1_4a1:1.8 PTH_1_3_4:1.8 PTH_1_3:1.8.0.2 PTH_1_3_3:1.8 PTH_1_3_2:1.8 PTH_1_3_1:1.8 PTH_1_3_0:1.8 PTH_1_3b3:1.8 PTH_1_2_3:1.4.2.1 PTH_1_3b2:1.8 PTH_1_3b1:1.8 PTH_1_3a5:1.8 PTH_1_3a4:1.8 PTH_1_3a3:1.8 PTH_1_2_2:1.4.2.1 PTH_1_3a2:1.8 PTH_1_2_1:1.4.2.1 PTH_1_3a1:1.6 PTH_1_2:1.4.0.2 PTH_1_2_0:1.4 PTH_1_2b8:1.3 PTH_1_2b7:1.3 PTH_1_1_6:1.2 PTH_1_2b6:1.3 PTH_1_2b5:1.3 PTH_1_2b4:1.3 PTH_1_2b3:1.3 PTH_1_2b2:1.2 PTH_1_2b1:1.2 PTH_1_1_5:1.2 PTH_1_1:1.2.0.2 PTH_1_1_4:1.2 PTH_1_1_3:1.2 PTH_1_1_2:1.2 PTH_1_1_1:1.2 PTH_1_1_0:1.2 PTH_1_1b7:1.1 PTH_1_1b6:1.1 PTH_1_1b5:1.1 PTH_1_1b4:1.1 PTH_1_1b3:1.1 PTH_1_1b2:1.1 PTH_1_1b1:1.1; locks; strict; comment @ * @; 1.16 date 2007.01.01.18.23.53; author rse; state Exp; branches; next 1.15; commitid 9DhdiirNzQPBIP0s; 1.15 date 2006.06.08.17.54.52; author rse; state Exp; branches; next 1.14; commitid x8N3mLVdQgkbdeAr; 1.14 date 2004.12.31.19.34.45; author rse; state Exp; branches; next 1.13; 1.13 date 2004.07.13.10.50.49; author rse; state Exp; branches; next 1.12; 1.12 date 2003.01.01.15.49.11; author rse; state Exp; branches; next 1.11; 1.11 date 2002.10.24.15.21.13; author rse; state Exp; branches; next 1.10; 1.10 date 2002.01.27.11.03.40; author rse; state Exp; branches; next 1.9; 1.9 date 2001.03.24.14.51.04; author rse; state Exp; branches; next 1.8; 1.8 date 99.12.30.21.59.00; author rse; state Exp; branches; next 1.7; 1.7 date 99.11.09.08.11.31; author rse; state Exp; branches; next 1.6; 1.6 date 99.11.01.10.44.31; author rse; state Exp; branches; next 1.5; 1.5 date 99.11.01.10.27.19; author rse; state Exp; branches; next 1.4; 1.4 date 99.10.31.11.46.12; author rse; state Exp; branches 1.4.2.1; next 1.3; 1.3 date 99.09.17.08.01.55; author rse; state Exp; branches; next 1.2; 1.2 date 99.08.19.15.08.52; author rse; state Exp; branches; next 1.1; 1.1 date 99.08.03.12.56.35; author rse; state Exp; branches; next ; 1.4.2.1 date 99.11.01.10.25.00; author rse; state Exp; branches; next ; desc @@ 1.16 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_ext.c: Pth extensions */ /* ``Killing for peace is like fucking for virginity.'' -- Unknown */ #include "pth_p.h" /* * Sfio Extension: * * We provide an Sfio discipline which can be pushed on an Sfio_t* stream * to use the Pth thread-aware I/O routines (pth_read/pth_write). */ #if PTH_EXT_SFIO static ssize_t pth_sfio_read(Sfio_t *f, Void_t *buf, size_t n, Sfdisc_t *disc) { ssize_t rv; rv = pth_read(sffileno(f), buf, n); return rv; } static ssize_t pth_sfio_write(Sfio_t *f, const Void_t *buf, size_t n, Sfdisc_t *disc) { ssize_t rv; rv = pth_write(sffileno(f), buf, n); return rv; } static Sfoff_t pth_sfio_seek(Sfio_t *f, Sfoff_t addr, int type, Sfdisc_t *disc) { return sfsk(f, addr, type, disc); } static int pth_sfio_except(Sfio_t *f, int type, Void_t* data, Sfdisc_t *disc) { int rv; switch (type) { case SF_LOCKED: case SF_READ: case SF_WRITE: case SF_SEEK: case SF_NEW: case SF_CLOSE: case SF_FINAL: case SF_DPUSH: case SF_DPOP: case SF_DBUFFER: case SF_DPOLL: case SF_READY: case SF_SYNC: case SF_PURGE: default: rv = 0; /* perform default action */ } return rv; } #endif /* PTH_EXT_SFIO */ Sfdisc_t *pth_sfiodisc(void) { #if PTH_EXT_SFIO Sfdisc_t *disc; if ((disc = (Sfdisc_t *)malloc(sizeof(Sfdisc_t))) == NULL) return pth_error((SFdisc_t *)NULL, errno); disc->readf = pth_sfio_read; disc->writef = pth_sfio_write; disc->seekf = pth_sfio_seek; disc->exceptf = pth_sfio_except; return disc; #else return pth_error((Sfdisc_t *)NULL, ENOSYS); #endif /* PTH_EXT_SFIO */ } @ 1.15 log @Adjusted all copyright messages for new year 2006 @ text @d3 1 a3 1 ** Copyright (c) 1999-2006 Ralf S. Engelschall @ 1.14 log @Adjusted all copyright messages for new year 2005. @ text @d3 1 a3 1 ** Copyright (c) 1999-2005 Ralf S. Engelschall @ 1.13 log @Adjusted all copyright messages for new year 2004. @ text @d3 1 a3 1 ** Copyright (c) 1999-2004 Ralf S. Engelschall @ 1.12 log @Adjusted all copyright messages for new year 2003. @ text @d3 1 a3 1 ** Copyright (c) 1999-2003 Ralf S. Engelschall @ 1.11 log @Internally switch from "errno_shield {...}" to "pth_shield {...}" and from "return_errno(..)" to "return pth_error(...)" in order to make the internal error handling a little bit more consistent. @ text @d3 1 a3 1 ** Copyright (c) 1999-2002 Ralf S. Engelschall @ 1.10 log @bump copyright year @ text @d93 1 a93 1 return NULL; d100 1 a100 1 return_errno(NULL, ENOSYS); @ 1.9 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2001 Ralf S. Engelschall @ 1.8 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999-2000 Ralf S. Engelschall @ 1.7 log @*** empty log message *** @ text @d3 1 a3 1 ** Copyright (c) 1999 Ralf S. Engelschall @ 1.6 log @*** empty log message *** @ text @d25 1 a25 1 /* ``Killing for peace is d66 1 a66 1 case SF_READ: @ 1.5 log @*** empty log message *** @ text @d33 1 a33 1 * We provide an Sfio discipline which can be pushed on a Sfio_t* stream @ 1.4 log @*** empty log message *** @ text @d2 1 a2 2 ** pth_ext.c -- Pth extensions ** d22 2 @ 1.4.2.1 log @*** empty log message *** @ text @d2 2 a3 1 ** GNU Pth - The GNU Portable Threads a22 2 ** ** pth_ext.c: Pth extensions @ 1.3 log @*** empty log message *** @ text @d12 1 a12 1 ** version 2 of the License, or (at your option) any later version. @ 1.2 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.1 log @*** empty log message *** @ text @d24 3 a26 1 @