gets man page on Cygwin

Man page or keyword search:  
man Server   22533 pages
apropos Keyword Search (all sections)
Output format
Cygwin logo
[printable version]

GETS(3)				    NEWLIB			       GETS(3)

NAME
       4.38 `gets'--get character string (obsolete, use `fgets' instead)

SYNOPSIS
	    #include <stdio.h>

	    char *gets(char *BUF);

	    char *_gets_r(struct _reent *REENT, char *BUF);

DESCRIPTION
       Reads  characters  from	standard  input until a newline is found.  The
       characters up to the newline are stored in BUF.	The  newline  is  dis‐
       carded, and the buffer is terminated with a 0.

	  This	is  a  _dangerous_  function, as it has no way of checking the
       amount of space available in BUF. One of the attacks used by the Inter‐
       net  Worm  of 1988 used this to overrun a buffer allocated on the stack
       of the finger daemon and overwrite the return address, causing the dae‐
       mon to execute code downloaded into it over the connection.

	  The  alternate function `_gets_r' is a reentrant version.  The extra
       argument REENT is a pointer to a reentrancy structure.

RETURNS
       `gets' returns the buffer passed to it, with the data filled in. If end
       of file occurs with some data already accumulated, the data is returned
       with no other indication. If end of file occurs with  no	 data  in  the
       buffer, NULL is returned.

	  Supporting  OS  subroutines  required:  `close',  `fstat', `isatty',
       `lseek', `read', `sbrk', `write'.

SEE ALSO
       gets is part of the library.  The full documentation for is  maintained
       as  a Texinfo manual.  If info and are properly installed at your site,
       the command

	      info

       will give you access to the complete manual.

NEWLIB				  April 2010			       GETS(3)
[top]

List of man pages available for Cygwin

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net