aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fgetws.c
Commit message (Collapse)AuthorAgeFilesLines
* libc: Purge unneeded cdefs.hWarner Losh2023-11-011-1/+0
| | | | | | | | | These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libc: drop "All rights reserved" from Foundation copyrightsEd Maste2022-08-041-1/+1
| | | | | | | | | This has already been done for most files that have the Foundation as the only listed copyright holder. Do it now for files that list multiple copyright holders, but have the Foundation copyright in its own section. Sponsored by: The FreeBSD Foundation
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Fix typo in the r320472 change to fgetws(). Return proper value.Konstantin Belousov2017-06-301-1/+1
| | | | | | | | | | Reported by: Oleg Ginzburg <olevole@olevole.ru> Reviewed by: vangyzen Sponsored by: The FreeBSD Foundation MFC after: 13 days Notes: svn path=/head/; revision=320508
* Make stdio deferred cancel-safe.Konstantin Belousov2017-06-291-5/+7
| | | | | | | | | | | | | | | | | | | | | | | If used with fopen(3)/fdopen(3)-ed FILEs, stdio accurately uses non-cancellable internal versions of the functions, i.e. it seems to be fine with regard to cancellation. But if the funopen(3) and f{r,w}open(3) functions were used to open the FILE, and corresponding user functions create cancellation points (they typically have no other choice), then stdio code at least leaks FILE' lock. The change installs cleanup handler which unlocks FILE. Some minimal restructuring of the code was required to make it use common return place to satisfy hand-rolled pthread_cleanup_pop() requirements. Noted by: eugen Reviewed by: eugen, vangyzen Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D11246 Notes: svn path=/head/; revision=320472
* Fix n == 1 case. Here should be no physical read (fill buffer) attemptAndrey A. Chernov2016-09-051-2/+6
| | | | | | | | | | (we read n - 1 chars with the room for NUL, see fgets()), and no NULL return. MFC after: 3 days Notes: svn path=/head/; revision=305412
* 1) Prevent out of bounds access to ws[-1] (passed buffer) which happensAndrey A. Chernov2016-09-051-2/+2
| | | | | | | | | | | | | when the first mb sequence is incomplete and there are not enougn chars in the read buffer. ws[-1] may lead to memory faults or false results, in case the memory here contains '\n'. 2) Fix EOF checking I mess in my previos r305406 commit. MFC after: 3 days Notes: svn path=/head/; revision=305409
* Fix errors handling.Andrey A. Chernov2016-09-051-6/+18
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=305406
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds aDavid Chisnall2011-11-201-3/+15
| | | | | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor) Notes: svn path=/head/; revision=227753
* Eliminate more dead stores.Garrett Wollman2009-11-251-1/+1
| | | | | | | | Found by: Clang static analyzer MFC after: 7 days Notes: svn path=/head/; revision=199784
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intoJohn Baldwin2008-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | __sFILE. This was supposed to be done in 6.0. Some notes: - Where possible I restored the various lines to their pre-__sFILEX state. - Retire INITEXTRA() and just initialize the wchar bits (orientation and mbstate) explicitly instead. The various places that used INITEXTRA didn't need the locking fields or _up initialized. (Some places needed _up to exist and not be off the end of a NULL or garbage pointer, but they didn't require it to be initialized to a specific value.) - For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to avoid namespace pollution of including all the pthread types in stdio.h. Once we remove all the inlines and make __sFILE private it can go back to using pthread_t, etc. - This does not remove any of the inlines currently and does not change any of the public ABI of 'FILE'. MFC after: 1 month Reviewed by: peter Notes: svn path=/head/; revision=178287
* Don't add integers to void pointers.Stefan Farfeleder2004-10-031-1/+2
| | | | Notes: svn path=/head/; revision=136092
* Read directly from the stdio buffer using the new __mbsnrtowcs() interfaceTim J. Robbins2004-07-211-14/+38
| | | | | | | instead of making repeated calls to __fgetwc(). Notes: svn path=/head/; revision=132498
* Lock the file once per call and use the unlocked fgetwc()/fputwc() variants.Tim J. Robbins2002-09-201-6/+14
| | | | Notes: svn path=/head/; revision=103678
* Reimplement the functionality of fgetrune(), fputrune(), and fungetrune()Tim J. Robbins2002-09-181-8/+5
| | | | | | | | | here in terms of mbrtowc(), wcrtomb(), and the single-byte I/O functions. The rune I/O functions are about to become deprecated in favour of the ones provided by ISO C90 Amd. 1 and C99. Notes: svn path=/head/; revision=103523
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-061-1/+1
| | | | Notes: svn path=/head/; revision=103012
* Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),Tim J. Robbins2002-08-131-0/+70
putwc(), fputwc(), putwchar(), ungetwc(), fwide(). Notes: svn path=/head/; revision=101776