Include namespace.h in a few of libc source files

The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change finishes elimination of usage of the global name of the
following symbols:
  - close -> _close
  - execve -> _execve
  - fcntl -> _fcntl
  - setcontext -> _setcontext
  - wait6 -> _wait6
  - write -> _write
  - writev -> _writev

Sponsored by <The NetBSD Foundation>
This commit is contained in:
kamil 2018-01-05 19:01:36 +00:00
parent 9b020cc558
commit 575eeceb5d
4 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: closefrom.c,v 1.2 2004/06/22 13:49:43 atatat Exp $ */
/* $NetBSD: closefrom.c,v 1.3 2018/01/05 19:01:36 kamil Exp $ */
/*
* Copyright (C) 2004 WIDE Project.
@ -31,9 +31,10 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: closefrom.c,v 1.2 2004/06/22 13:49:43 atatat Exp $");
__RCSID("$NetBSD: closefrom.c,v 1.3 2018/01/05 19:01:36 kamil Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <fcntl.h>
#include <unistd.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: exect.c,v 1.1 2017/02/07 19:29:40 kamil Exp $ */
/* $NetBSD: exect.c,v 1.2 2018/01/05 19:01:36 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -28,9 +28,10 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: exect.c,v 1.1 2017/02/07 19:29:40 kamil Exp $");
__RCSID("$NetBSD: exect.c,v 1.2 2018/01/05 19:01:36 kamil Exp $");
#endif
#include "namespace.h"
#include <unistd.h>
__warn_references(exect,

View File

@ -1,4 +1,4 @@
/* $NetBSD: fopen.c,v 1.17 2017/11/09 20:30:02 christos Exp $ */
/* $NetBSD: fopen.c,v 1.18 2018/01/05 19:01:36 kamil Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -37,10 +37,11 @@
#if 0
static char sccsid[] = "@(#)fopen.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: fopen.c,v 1.17 2017/11/09 20:30:02 christos Exp $");
__RCSID("$NetBSD: fopen.c,v 1.18 2018/01/05 19:01:36 kamil Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: freopen.c,v 1.20 2017/11/09 20:30:02 christos Exp $ */
/* $NetBSD: freopen.c,v 1.21 2018/01/05 19:01:36 kamil Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -37,10 +37,11 @@
#if 0
static char sccsid[] = "@(#)freopen.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: freopen.c,v 1.20 2017/11/09 20:30:02 christos Exp $");
__RCSID("$NetBSD: freopen.c,v 1.21 2018/01/05 19:01:36 kamil Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
#include <sys/stat.h>