X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffreadptr.c;h=27c2285a8cad6f9c3fb47a17d5d3e0247b9f8ca8;hb=72983fb6b5bd6c7de54465eea29464bb9c0276cf;hp=afd7a3eb521a6dc3297eea8bf30d8fbc93958a57;hpb=d4d84c1d916f5bff3bb72be92e9d1383a25077c1;p=gnulib.git diff --git a/lib/freadptr.c b/lib/freadptr.c index afd7a3eb5..27c2285a8 100644 --- a/lib/freadptr.c +++ b/lib/freadptr.c @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2011 Free Software Foundation, Inc. + Copyright (C) 2007-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -101,6 +101,13 @@ freadptr (FILE *fp, size_t *sizep) return NULL; *sizep = size; return fp->__bufp; +#elif defined EPLAN9 /* Plan9 */ + if (fp->state == 4 /* WR */) + return NULL; + if (fp->rp >= fp->wp) + return NULL; + *sizep = fp->wp - fp->rp; + return fp->rp; #elif defined SLOW_BUT_NO_HACKS /* users can define this */ /* This implementation is correct on any ANSI C platform. It is just awfully slow. */