aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/ed/glbl.c1
-rw-r--r--bin/ed/undo.c1
-rw-r--r--bin/expr/expr.c1
-rw-r--r--bin/ksh/edit.c1
-rw-r--r--bin/ksh/lex.c1
-rw-r--r--bin/ls/print.c1
-rw-r--r--bin/ls/utf8.c1
-rw-r--r--bin/md5/crc.c2
-rw-r--r--include/stdio.h3
-rw-r--r--include/stdlib.h4
-rw-r--r--include/string.h3
-rw-r--r--include/wchar.h2
-rw-r--r--lib/libopenbsd/compat/fgetwln.c1
-rw-r--r--lib/libopenbsd/db/btree/bt_open.c1
-rw-r--r--lib/libopenbsd/db/hash/hash_page.c2
-rw-r--r--lib/libopenbsd/gen/fts.c1
-rw-r--r--lib/libopenbsd/gen/glob.c1
-rw-r--r--lib/libopenbsd/gen/setmode.c1
-rw-r--r--lib/libopenbsd/gen/vis.c1
-rw-r--r--lib/libopenbsd/regex/regcomp.c1
-rw-r--r--lib/libopenbsd/regex/regexec.c1
-rw-r--r--lib/liboutil/imsg-buffer.c2
-rw-r--r--lib/liboutil/pidfile.c2
-rw-r--r--libexec/Makefile3
-rw-r--r--usr.bin/Makefile2
-rw-r--r--usr.bin/apply/apply.c1
-rw-r--r--usr.bin/awk/b.c1
-rw-r--r--usr.bin/awk/run.c1
-rw-r--r--usr.bin/awk/tran.c1
-rw-r--r--usr.bin/bc/bc.y1
-rw-r--r--usr.bin/cal/cal.c1
-rw-r--r--usr.bin/calendar/io.c1
-rw-r--r--usr.bin/col/col.c1
-rw-r--r--usr.bin/colrm/colrm.c2
-rw-r--r--usr.bin/column/column.c1
-rw-r--r--usr.bin/compress/main.c1
-rw-r--r--usr.bin/cu/cu.c1
-rw-r--r--usr.bin/dc/bcode.c1
-rw-r--r--usr.bin/dc/dc.c1
-rw-r--r--usr.bin/dc/inout.c1
-rw-r--r--usr.bin/dc/mem.c1
-rw-r--r--usr.bin/diff/xmalloc.c3
-rw-r--r--usr.bin/fmt/fmt.c1
-rw-r--r--usr.bin/fold/fold.c1
-rw-r--r--usr.bin/from/from.c1
-rw-r--r--usr.bin/ftp/cmds.c1
-rw-r--r--usr.bin/ftp/cookie.c1
-rw-r--r--usr.bin/ftp/fetch.c1
-rw-r--r--usr.bin/hexdump/parse.c4
-rw-r--r--usr.bin/htpasswd/htpasswd.c1
-rw-r--r--usr.bin/mail/def.h1
-rw-r--r--usr.bin/mail/edit.c1
-rw-r--r--usr.bin/mktemp/mktemp.c1
-rw-r--r--usr.bin/newsyslog/newsyslog.c1
-rw-r--r--usr.bin/patch/backupfile.c1
-rw-r--r--usr.bin/patch/patch.c1
-rw-r--r--usr.bin/pr/pr.c1
-rw-r--r--usr.bin/rcs/diff.c1
-rw-r--r--usr.bin/rcs/rcs.c2
-rw-r--r--usr.bin/rcs/rcsparse.c1
-rw-r--r--usr.bin/rs/utf8.c1
-rw-r--r--usr.bin/sdiff/edit.c1
-rw-r--r--usr.bin/sdiff/sdiff.c1
-rw-r--r--usr.bin/signify/signify.c1
-rw-r--r--usr.bin/sort/mem.c1
-rw-r--r--usr.bin/stat/stat.c9
-rw-r--r--usr.bin/telnet/commands.c1
-rw-r--r--usr.bin/tftp/tftp.c1
-rw-r--r--usr.bin/touch/touch.c1
-rw-r--r--usr.bin/unifdef/unifdef.c1
-rw-r--r--usr.bin/whois/whois.c1
71 files changed, 14 insertions, 87 deletions
diff --git a/bin/ed/glbl.c b/bin/ed/glbl.c
index 8d02344..27ebc0c 100644
--- a/bin/ed/glbl.c
+++ b/bin/ed/glbl.c
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/ioctl.h>
#include <sys/wait.h>
diff --git a/bin/ed/undo.c b/bin/ed/undo.c
index 0acdd37..4291be0 100644
--- a/bin/ed/undo.c
+++ b/bin/ed/undo.c
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <regex.h>
#include <signal.h>
#include <stdio.h>
diff --git a/bin/expr/expr.c b/bin/expr/expr.c
index 2898ef4..30b2aed 100644
--- a/bin/expr/expr.c
+++ b/bin/expr/expr.c
@@ -6,7 +6,6 @@
* Public domain.
*/
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdint.h>
diff --git a/bin/ksh/edit.c b/bin/ksh/edit.c
index 26a2d6a..99cce0d 100644
--- a/bin/ksh/edit.c
+++ b/bin/ksh/edit.c
@@ -5,7 +5,6 @@
*
*/
-#define _GNU_SOURCE
#include "config.h"
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index efc4cea..74dc56d 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -4,7 +4,6 @@
* lexical analysis and source input
*/
-#define _GNU_SOURCE
#include <sys/time.h>
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 6ebacf9..831dfcc 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -33,7 +33,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/bin/ls/utf8.c b/bin/ls/utf8.c
index 89f8a08..e593b24 100644
--- a/bin/ls/utf8.c
+++ b/bin/ls/utf8.c
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
#ifndef SMALL
#include <stdio.h>
diff --git a/bin/md5/crc.c b/bin/md5/crc.c
index 2de1124..05a253f 100644
--- a/bin/md5/crc.c
+++ b/bin/md5/crc.c
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
-
#include <sys/types.h>
#include <errno.h>
diff --git a/include/stdio.h b/include/stdio.h
index a30914a..89da563 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -7,4 +7,7 @@
char *fgetln(FILE *, size_t *);
+int asprintf(char **, const char *, ...);
+int vasprintf(char **, const char *, va_list);
+
#endif /* _COMPAT STDIO_H_ */
diff --git a/include/stdlib.h b/include/stdlib.h
index 07ff224..9dee035 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -57,9 +57,7 @@ void arc4random_buf(void *, size_t)
__attribute__((__bounded__ (__string__,1,2)));
char *devname(dev_t, mode_t);
void freezero(void *, size_t);
-#ifndef HAVE_REALLOCARRAY
void *reallocarray(void *, size_t, size_t);
-#endif
void *recallocarray(void *, size_t, size_t, size_t);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
@@ -79,6 +77,8 @@ char *setstate(char *);
/* void srand_deterministic(unsigned int); */
#define srand_deterministic(x) srand((x))
+int mkostemp(char *, int);
+
#endif /* _COMPAT_STDLIB_H_ */
#include_next <stdlib.h>
diff --git a/include/string.h b/include/string.h
index afd5f29..eb0c58b 100644
--- a/include/string.h
+++ b/include/string.h
@@ -48,6 +48,9 @@ void strmode(int, char *);
int timingsafe_bcmp(const void *, const void *, size_t);
int timingsafe_memcmp(const void *, const void *, size_t);
+char *strcasestr(const char *, const char *);
+void *memrchr(const void *, int, size_t);
+
#endif /* _COMPAT_STRING_H_ */
#include_next <string.h>
diff --git a/include/wchar.h b/include/wchar.h
index fd9da70..5277c16 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -7,4 +7,6 @@
wchar_t *fgetwln(FILE *__restrict, size_t *__restrict);
+int wcwidth(wchar_t);
+
#endif /* !_COMPAT_WCHAR_H_ */
diff --git a/lib/libopenbsd/compat/fgetwln.c b/lib/libopenbsd/compat/fgetwln.c
index c4f3425..c1c1d39 100644
--- a/lib/libopenbsd/compat/fgetwln.c
+++ b/lib/libopenbsd/compat/fgetwln.c
@@ -24,7 +24,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarry */
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
diff --git a/lib/libopenbsd/db/btree/bt_open.c b/lib/libopenbsd/db/btree/bt_open.c
index a31639b..70fe2ec 100644
--- a/lib/libopenbsd/db/btree/bt_open.c
+++ b/lib/libopenbsd/db/btree/bt_open.c
@@ -41,7 +41,6 @@
*/
#define __NEED_OPENBSD_open
-#define _GNU_SOURCE /* for mkostemp */
#include <sys/stat.h>
diff --git a/lib/libopenbsd/db/hash/hash_page.c b/lib/libopenbsd/db/hash/hash_page.c
index 68246bb..8e273db 100644
--- a/lib/libopenbsd/db/hash/hash_page.c
+++ b/lib/libopenbsd/db/hash/hash_page.c
@@ -48,8 +48,6 @@
* open_temp
*/
-#define _GNU_SOURCE /* for mkostemp */
-
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
diff --git a/lib/libopenbsd/gen/fts.c b/lib/libopenbsd/gen/fts.c
index 12b9b5c..125a37f 100644
--- a/lib/libopenbsd/gen/fts.c
+++ b/lib/libopenbsd/gen/fts.c
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/param.h> /* ALIGN */
#include <sys/stat.h>
diff --git a/lib/libopenbsd/gen/glob.c b/lib/libopenbsd/gen/glob.c
index 44df0b2..dafae84 100644
--- a/lib/libopenbsd/gen/glob.c
+++ b/lib/libopenbsd/gen/glob.c
@@ -56,7 +56,6 @@
* Number of matches in the current invocation of glob.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/stat.h>
#include <ctype.h>
diff --git a/lib/libopenbsd/gen/setmode.c b/lib/libopenbsd/gen/setmode.c
index b9b1119..02a5a92 100644
--- a/lib/libopenbsd/gen/setmode.c
+++ b/lib/libopenbsd/gen/setmode.c
@@ -32,7 +32,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/lib/libopenbsd/gen/vis.c b/lib/libopenbsd/gen/vis.c
index c72f5af..4400c7b 100644
--- a/lib/libopenbsd/gen/vis.c
+++ b/lib/libopenbsd/gen/vis.c
@@ -28,7 +28,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <errno.h>
#include <ctype.h>
diff --git a/lib/libopenbsd/regex/regcomp.c b/lib/libopenbsd/regex/regcomp.c
index 41b0e68..19c86cc 100644
--- a/lib/libopenbsd/regex/regcomp.c
+++ b/lib/libopenbsd/regex/regcomp.c
@@ -34,7 +34,6 @@
* @(#)regcomp.c 8.5 (Berkeley) 3/20/94
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/libopenbsd/regex/regexec.c b/lib/libopenbsd/regex/regexec.c
index bb5d032..ed6a4b8 100644
--- a/lib/libopenbsd/regex/regexec.c
+++ b/lib/libopenbsd/regex/regexec.c
@@ -41,7 +41,6 @@
* macros that code uses. This lets the same code operate on two different
* representations for state sets.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/liboutil/imsg-buffer.c b/lib/liboutil/imsg-buffer.c
index 2b44a60..324b3de 100644
--- a/lib/liboutil/imsg-buffer.c
+++ b/lib/liboutil/imsg-buffer.c
@@ -16,7 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#define _GNU_SOURCE /* for iov */
#include <sys/types.h>
#include <sys/queue.h>
diff --git a/lib/liboutil/pidfile.c b/lib/liboutil/pidfile.c
index e76ba4e..af049d1 100644
--- a/lib/liboutil/pidfile.c
+++ b/lib/liboutil/pidfile.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#define _GNU_SOURCE
-
#include <sys/types.h>
#include <errno.h>
#include <paths.h>
diff --git a/libexec/Makefile b/libexec/Makefile
index 6d70e96..73e3e49 100644
--- a/libexec/Makefile
+++ b/libexec/Makefile
@@ -1,8 +1,9 @@
# from: @(#)Makefile 5.7 (Berkeley) 4/1/91
# $OpenBSD: Makefile,v 1.65 2015/11/26 19:13:14 deraadt Exp $
-TOPDIR?=..
+.TOPDIR?=..
SUBDIR= tradcpp
+#getty
include ${.TOPDIR}/mk/bsd.subdir.mk
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 3feffb8..8655bd8 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -3,7 +3,7 @@ SUBDIR= apply awk basename bc biff cal calendar cmp colrm col column comm \
cut dc dirname du diff3 diff encrypt env expand false file find fmt fold \
from ftp getconf getent getopt grep head hexdump id indent join jot lam leave \
lndir logger logname look lorder mail mkdep mktemp nice nl nohup paste patch \
- pkg-config pr printenv printf readlink renice rev rs sdiff sed shar signify \
+ pkg-config pr printenv printf rcs readlink renice rev rs sdiff sed shar signify \
sort spell split stat tail tee telnet tftp time touch tr true tsort tty \
ul units uname unexpand uniq unvis uudecode uuencode vacation vis wc what \
which xinstall htpasswd cu newsyslog banner cap_mkdb unifdef whois xargs \
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index cad43cd..b6a7f8c 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -33,7 +33,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <sys/wait.h>
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c
index 20a4c75..5091823 100644
--- a/usr.bin/awk/b.c
+++ b/usr.bin/awk/b.c
@@ -27,7 +27,6 @@ THIS SOFTWARE.
#define DEBUG
-#define _GNU_SOURCE /* for reallocarray */
#include <ctype.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c
index 01d03ae..17dcf0c 100644
--- a/usr.bin/awk/run.c
+++ b/usr.bin/awk/run.c
@@ -24,7 +24,6 @@ THIS SOFTWARE.
****************************************************************/
#define DEBUG
-#define _GNU_SOURCE /* for reallocarray */
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c
index cec7d08..14ace3e 100644
--- a/usr.bin/awk/tran.c
+++ b/usr.bin/awk/tran.c
@@ -23,7 +23,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-#define _GNU_SOURCE
#define DEBUG
#include <stdio.h>
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y
index b820fc6..c1b7f6f 100644
--- a/usr.bin/bc/bc.y
+++ b/usr.bin/bc/bc.y
@@ -29,7 +29,6 @@
* the same as the code generated by the older version, to provide
* easy regression testing.
*/
-#define _GNU_SOURCE /* for reallocarry, asprintf */
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c
index 79f3d16..12974c3 100644
--- a/usr.bin/cal/cal.c
+++ b/usr.bin/cal/cal.c
@@ -33,7 +33,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <sys/types.h>
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index 5fefac6..d923386 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <sys/stat.h>
#include <sys/time.h>
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index d5df738..c3c51b4 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -33,7 +33,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <ctype.h>
#include <err.h>
#include <string.h>
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 94f1415..d4fcfe7 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -30,8 +30,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
-
#include <sys/types.h>
#include <err.h>
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index 105836e..377e38a 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/types.h>
#include <sys/ioctl.h>
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c
index fad7846..9152b31 100644
--- a/usr.bin/compress/main.c
+++ b/usr.bin/compress/main.c
@@ -30,7 +30,6 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <sys/time.h>
#include <sys/stat.h>
diff --git a/usr.bin/cu/cu.c b/usr.bin/cu/cu.c
index 33ae9a1..03a2df4 100644
--- a/usr.bin/cu/cu.c
+++ b/usr.bin/cu/cu.c
@@ -15,7 +15,6 @@
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* asprintf */
#include <sys/ioctl.h>
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c
index b770f85..d219d8c 100644
--- a/usr.bin/dc/bcode.c
+++ b/usr.bin/dc/bcode.c
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <err.h>
#include <limits.h>
#include <signal.h>
diff --git a/usr.bin/dc/dc.c b/usr.bin/dc/dc.c
index d283ddb..bdab3b9 100644
--- a/usr.bin/dc/dc.c
+++ b/usr.bin/dc/dc.c
@@ -15,7 +15,6 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/stat.h>
#include <err.h>
diff --git a/usr.bin/dc/inout.c b/usr.bin/dc/inout.c
index 82eb4e3..4399b4e 100644
--- a/usr.bin/dc/inout.c
+++ b/usr.bin/dc/inout.c
@@ -15,7 +15,6 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <ctype.h>
#include <err.h>
diff --git a/usr.bin/dc/mem.c b/usr.bin/dc/mem.c
index 98b80a1..f954eeb 100644
--- a/usr.bin/dc/mem.c
+++ b/usr.bin/dc/mem.c
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for reallocarray */
#include <openssl/err.h>
#include <err.h>
diff --git a/usr.bin/diff/xmalloc.c b/usr.bin/diff/xmalloc.c
index a784513..a17c3fe 100644
--- a/usr.bin/diff/xmalloc.c
+++ b/usr.bin/diff/xmalloc.c
@@ -12,9 +12,6 @@
* incompatible with the protocol description in the RFC file, it must be
* called by a name other than "ssh" or "Secure Shell".
*/
-#if defined(__linux__) && !defined(_GNU_SOURCE)
-#define _GNU_SOURCE /* for vasprintf */
-#endif
#include <err.h>
#include <stdarg.h>
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index 416fa79..6e3de03 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -174,7 +174,6 @@
* been tested on my FreeBSD machine. Your mileage may vary.
*/
-#define _GNU_SOURCE
#include <ctype.h>
#include <err.h>
diff --git a/usr.bin/fold/fold.c b/usr.bin/fold/fold.c
index 790706e..67e9578 100644
--- a/usr.bin/fold/fold.c
+++ b/usr.bin/fold/fold.c
@@ -33,7 +33,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <ctype.h>
#include <err.h>
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index 04ad97c..bd2bd69 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -29,7 +29,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/types.h>
#include <ctype.h>
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index 33e94bc..8cd34c3 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -59,7 +59,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for asprintf */
#ifndef SMALL
diff --git a/usr.bin/ftp/cookie.c b/usr.bin/ftp/cookie.c
index 9bbbf7f..907fcad 100644
--- a/usr.bin/ftp/cookie.c
+++ b/usr.bin/ftp/cookie.c
@@ -16,7 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for asprintf */
#ifndef NOSSL
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 7420e88..3fb25db 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -34,7 +34,6 @@
* FTP User Program -- Command line file retrieval
*/
-#define _GNU_SOURCE /* for asprintf, vasprintf */
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c
index 895d90d..103bf93 100644
--- a/usr.bin/hexdump/parse.c
+++ b/usr.bin/hexdump/parse.c
@@ -30,10 +30,6 @@
* SUCH DAMAGE.
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif /* _GNU_SOURCE */
-
#include <sys/types.h>
#include <sys/file.h>
diff --git a/usr.bin/htpasswd/htpasswd.c b/usr.bin/htpasswd/htpasswd.c
index 54c0423..be73590 100644
--- a/usr.bin/htpasswd/htpasswd.c
+++ b/usr.bin/htpasswd/htpasswd.c
@@ -15,7 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/stat.h>
#ifdef __linux__
diff --git a/usr.bin/mail/def.h b/usr.bin/mail/def.h
index e796279..dd088cd 100644
--- a/usr.bin/mail/def.h
+++ b/usr.bin/mail/def.h
@@ -42,7 +42,6 @@
#ifndef MAIL_DEF_H
#define MAIL_DEF_H
-#define _GNU_SOURCE /* for strcasestr */
#include <sys/stat.h>
diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c
index b994d8b..226d36f 100644
--- a/usr.bin/mail/edit.c
+++ b/usr.bin/mail/edit.c
@@ -29,7 +29,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c
index ae6075c..1d1a7a4 100644
--- a/usr.bin/mktemp/mktemp.c
+++ b/usr.bin/mktemp/mktemp.c
@@ -17,7 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
#include <err.h>
#include <paths.h>
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index ea3ae99..9ebeaf3 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -71,7 +71,6 @@
*
*/
-#define _GNU_SOURCE
#define CONF "/etc/newsyslog.conf"
#define PIDFILE "/var/run/syslog.pid"
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c
index 407bb7e..0d86eb9 100644
--- a/usr.bin/patch/backupfile.c
+++ b/usr.bin/patch/backupfile.c
@@ -16,7 +16,6 @@
* David MacKenzie <djm@ai.mit.edu>. Some algorithms adapted from GNU Emacs.
*/
-#define _GNU_SOURCE
#include <ctype.h>
#include <dirent.h>
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index d85d675..bcd74fd 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -26,7 +26,6 @@
* behaviour
*/
-#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index e853b9c..0342df9 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -32,7 +32,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for vasprintf */
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c
index e7e76a9..3d4445f 100644
--- a/usr.bin/rcs/diff.c
+++ b/usr.bin/rcs/diff.c
@@ -64,7 +64,6 @@
* @(#)diffreg.c 8.1 (Berkeley) 6/6/93
*/
-#define _GNU_SOURCE /* for vasprintf */
#include <sys/stat.h>
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 9047067..b50801d 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -24,8 +24,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for memrchr */
-
#include <sys/param.h> /* MAXBSIZE */
#include <sys/stat.h>
diff --git a/usr.bin/rcs/rcsparse.c b/usr.bin/rcs/rcsparse.c
index e77568c..b0cf4b7 100644
--- a/usr.bin/rcs/rcsparse.c
+++ b/usr.bin/rcs/rcsparse.c
@@ -15,7 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for vasprintf */
#include <sys/queue.h>
diff --git a/usr.bin/rs/utf8.c b/usr.bin/rs/utf8.c
index ff4b3b1..7fda1f7 100644
--- a/usr.bin/rs/utf8.c
+++ b/usr.bin/rs/utf8.c
@@ -14,7 +14,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
#include <err.h>
#include <stdlib.h>
diff --git a/usr.bin/sdiff/edit.c b/usr.bin/sdiff/edit.c
index 700b71f..386dc38 100644
--- a/usr.bin/sdiff/edit.c
+++ b/usr.bin/sdiff/edit.c
@@ -4,7 +4,6 @@
* Written by Raymond Lai <ray@cyth.net>.
* Public domain.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c
index a84cb69..59f9515 100644
--- a/usr.bin/sdiff/sdiff.c
+++ b/usr.bin/sdiff/sdiff.c
@@ -4,7 +4,6 @@
* Written by Raymond Lai <ray@cyth.net>.
* Public domain.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/queue.h>
#include <sys/stat.h>
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index 6085998..080ca6f 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -15,7 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/stat.h>
diff --git a/usr.bin/sort/mem.c b/usr.bin/sort/mem.c
index def25f2..e3e7aaf 100644
--- a/usr.bin/sort/mem.c
+++ b/usr.bin/sort/mem.c
@@ -27,7 +27,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <err.h>
#include <stdio.h>
diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c
index 737497c..062eb58 100644
--- a/usr.bin/stat/stat.c
+++ b/usr.bin/stat/stat.c
@@ -30,15 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if defined(__linux__)
-# if !defined(_GNU_SOURCE)
-# define _GNU_SOURCE
-# endif
-# if !defined(_XOPEN_SOURCE)
-# define _XOPEN_SOURCE
-# endif
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index a09391b..b455913 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -29,7 +29,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include "telnet_locl.h"
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index b6f1214..34044fb 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -36,7 +36,6 @@
* This version includes many modifications by Jim Guyton <guyton@rand-unix>
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index 2f430ee..1853e3d 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c
index bfc58e6..3e13b51 100644
--- a/usr.bin/unifdef/unifdef.c
+++ b/usr.bin/unifdef/unifdef.c
@@ -42,7 +42,6 @@
* These require better buffer handling, which would also make
* it possible to handle all "dodgy" directives correctly.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/stat.h>
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 7e10240..f354c5d 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE /* for asprintf */
#include <sys/types.h>
#include <sys/socket.h>