aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/gets.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-29Use remove-advertising-clause script to edit BSD licensesKeith Packard1-1/+1
This edits licenses held by Berkeley and NetBSD, both of which have removed the advertising requirement from their licenses. Signed-off-by: Keith Packard <keithp@keithp.com>
2018-01-17ansification: remove _DEFUNYaakov Selkowitz1-4/+2
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17ansification: remove _ANDYaakov Selkowitz1-1/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01stdio: remove TRAD_SYNOPSISYaakov Selkowitz1-11/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-07-02Prevent use of uninitialized file lockSebastian Huber1-4/+8
The CHECK_INIT() is necessary before the _newlib_flockfile_start() since this would use otherwise acquire an uninitialized lock which gets initialized after this leading to a corrupt release. newlib/ChangeLog 2015-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de> libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT(). libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and CHECK_INIT(). Use _stdin_r() to get the file pointer instead of stdin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2012-05-30 * libc/stdio/local.h (_newlib_flockfile_start): New macro toCorinna Vinschen1-3/+4
secure stream related critical section against thread cancellation. (_newlib_flockfile_exit): Ditto. (_newlib_sfp_lock_end): Ditto. (_newlib_sfp_lock_start): Ditto for the list of streams. (_newlib_sfp_lock_exit): Ditto. (_newlib_sfp_lock_end): Ditto. Use aforementioned macros in place of _flockfile/_funlockfile and __sfp_lock_acquire/__sfp_lock_release throughout the code. * libc/stdio/fclose.c: Explicitely disable and re-enable thread cancellation. Explain why. * libc/stdio/freopen.c: Ditto. * libc/stdio64/freopen64.c: Ditto.
2011-01-28 * libc/stdio/fclose.c: Only use sfp lock to guard non-atomicCorinna Vinschen1-3/+0
changes of flags and fp lock. * libc/stdio/freopen.c: Ditto. * libc/stdio/freopen64.c: Ditto. * libc/stdio/fgetc.c: Revert change from 2009-04-24, remove sfp locks which guard entire function to avoid potential deadlocks when using stdio functions in multiple thraeds. * libc/stdio/fgets.c: Ditto. * libc/stdio/fgetwc.c: Ditto. * libc/stdio/fgetws.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio/getc.c: Ditto. * libc/stdio/getdelim.c: Ditto. * libc/stdio/gets.c: Ditto. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/vfwscanf.c: Ditto. * libc/stdio/fflush.c (_fflush_r): Split out core functionality into new function __sflush_r. Just lock file and call __sflush_r from here. * libc/stdio/fwalk.c (_fwalk): Remove static helper function and move functionality back into main function. Don't walk a file with flags value of 1. Add comment. (_fwalk_reent): Ditto. * libc/stdio/local.h (__sflush_r): Declare. * libc/stdio/refill.c (__srefill): Before calling fwalk, set flags value to 1 so this file pointer isn't walked. Revert flags afterwards and call __sflush_r for this fp if necessary. Add comments.
2009-04-242009-04-24 Jeff johnston <jjohnstn@redhat.com>Jeff Johnston1-0/+3
* libc/stdio/fgetc.c: Make sure sfp lock is acquired before the file lock and released before the file lock to avoid a deadlock scenario. * libc/stdio/fgets.c: Ditto. * libc/stdio/fgetwc.c: Ditto. * libc/stdio/fgetws.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio/getc.c: Ditto. * libc/stdio/getdelim.c: Ditto. * libc/stdio/gets.c: Ditto.
2008-11-25 * libc/stdio/gets.c (_gets_r): Lock stdin here and callCorinna Vinschen1-2/+7
__sgetc_r instead of _getchar_r.
2004-04-232004-04-23 Artem B. Bityuckiy <abitytsky@softminecorp.com>Jeff Johnston1-10/+11
* libc/stdio/asprintf.c libc/stdio/clearerr.c, libc/stdio/fclose.c libc/stdio/fcloseall.c libc/stdio/fdopen.c, libc/stdio/feof.c libc/stdio/ferror.c libc/stdio/fflush.c, libc/stdio/fgetc.c libc/stdio/fgetpos.c libc/stdio/fgets.c, libc/stdio/fileno.c libc/stdio/findfp.c libc/stdio/fiprintf.c, libc/stdio/flags.c libc/stdio/fopen.c libc/stdio/fprintf.c, libc/stdio/fputc.c libc/stdio/fputs.c libc/stdio/fread.c, libc/stdio/freopen.c libc/stdio/fscanf.c libc/stdio/fseek.c, libc/stdio/fseeko.c libc/stdio/fsetpos.c libc/stdio/ftell.c, libc/stdio/ftello.c libc/stdio/fvwrite.c libc/stdio/fwalk.c, libc/stdio/fwrite.c libc/stdio/getc.c libc/stdio/getc_u.c, libc/stdio/getchar.c libc/stdio/getchar_u.c, libc/stdio/getdelim.c libc/stdio/getline.c libc/stdio/gets.c, libc/stdio/getw.c libc/stdio/iprintf.c libc/stdio/local.h, libc/stdio/makebuf.c libc/stdio/mktemp.c libc/stdio/perror.c, libc/stdio/printf.c libc/stdio/putc.c libc/stdio/putc_u.c, libc/stdio/putchar.c libc/stdio/putchar_u.c libc/stdio/puts.c, libc/stdio/putw.c libc/stdio/refill.c libc/stdio/remove.c, libc/stdio/rename.c libc/stdio/rewind.c libc/stdio/rget.c, libc/stdio/scanf.c libc/stdio/setbuf.c libc/stdio/setbuffer.c, libc/stdio/setlinebuf.c libc/stdio/setvbuf.c, libc/stdio/siprintf.c libc/stdio/snprintf.c, libc/stdio/sprintf.c libc/stdio/sscanf.c libc/stdio/stdio.c, libc/stdio/tmpfile.c libc/stdio/tmpnam.c libc/stdio/ungetc.c, libc/stdio/vasprintf.c libc/stdio/vfieeefp.h, libc/stdio/vfprintf.c libc/stdio/vfscanf.c, libc/stdio/vprintf.c libc/stdio/vscanf.c, libc/stdio/vsnprintf.c libc/stdio/vsprintf.c, libc/stdio/vsscanf.c libc/stdio/wbuf.c, libc/stdio/wsetup.c: Perform minor formatting changes. Move copyright notices to top of file, ensure that <_ansi.h> is included, be consistent with open parentheses, use _DEFUN macro, include "local.h" where needed, and remove various compiler warnings.
2000-02-17import newlib-2000-02-17 snapshotChristopher Faylor1-0/+102