From 4e520c8c36e84af20391c82fbc11810497e10296 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 23 Sep 2013 22:10:29 +0200 Subject: [PATCH] Remove sortix_gets(3). --- libc/include/stdio.h | 7 ------- libc/stdio/stdio.cpp | 11 ----------- 2 files changed, 18 deletions(-) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 78acf9e6..2ec04974 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -174,13 +174,6 @@ extern FILE* _firstfile; #endif #endif -#if (defined(_SOURCE_SOURCE) && __SORTIX_STDLIB_REDIRECTS) || \ - defined(_WANT_SORTIX_GETS) -char* gets(void) asm ("sortix_gets"); -#else -/* traditional gets(3) is no longer POSIX, hence removed. */ -#endif - #if defined(_SORTIX_SOURCE) || defined(_WANT_SORTIX_VPRINTF_CALLBACK) size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t), void* user, diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp index efd9d3e3..d75e8926 100644 --- a/libc/stdio/stdio.cpp +++ b/libc/stdio/stdio.cpp @@ -57,17 +57,6 @@ extern "C" int putchar(int c) return fputc(c, stdout); } -extern "C" char* sortix_gets(void) -{ - char* buf = NULL; - size_t n; - if ( getline(&buf, &n, stdin) < 0 ) - return NULL; - size_t linelen = strlen(buf); - if ( linelen && buf[linelen-1] == '\n' ) { buf[linelen-1] = 0; } - return buf; -} - extern "C" int puts(const char* str) { return printf("%s\n", str) < 0 ? EOF : 1;