From d5eca691e8b6855d5040827f112710189f61be13 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sat, 22 Oct 2016 10:32:34 +0200
Subject: [PATCH 2/2] compat-43 WIP

---
 Makefile_upgrade.inc                              |  7 ++++
 lib/libc/compat-43/Makefile.inc                   | 10 +----
 lib/libc/compat-43/Symbol.map                     |  9 -----
 lib/libc/compat-43/getwd.c                        | 48 -----------------------
 lib/libc/compat-43/{sigblock.2 => sigblock.3}     |  7 ++--
 lib/libc/compat-43/{sigpause.2 => sigpause.3}     |  9 ++---
 lib/libc/compat-43/{sigsetmask.2 => sigsetmask.3} | 11 +++---
 lib/libc/compat-43/{sigvec.2 => sigvec.3}         | 17 ++++----
 lib/libc/gen/Makefile.inc                         | 20 +++++-----
 lib/libc/gen/Symbol.map                           |  6 +++
 lib/libc/{compat-43/creat.2 => gen/creat.3}       |  5 +--
 lib/libc/{compat-43 => gen}/creat.c               |  1 -
 lib/libc/gen/getcwd.c                             | 13 +++++-
 lib/libc/{compat-43 => gen}/gethostid.3           |  1 -
 lib/libc/{compat-43 => gen}/gethostid.c           |  1 -
 lib/libc/{compat-43/killpg.2 => gen/killpg.3}     |  5 +--
 lib/libc/{compat-43 => gen}/killpg.c              |  1 -
 lib/libc/sys/Makefile.inc                         |  2 +-
 lib/libc/sys/kill.2                               |  7 ++--
 lib/libutil/uucplock.3                            |  2 +-
 sys/sys/fcntl.h                                   |  2 +-
 21 files changed, 67 insertions(+), 117 deletions(-)
 delete mode 100644 lib/libc/compat-43/getwd.c
 rename lib/libc/compat-43/{sigblock.2 => sigblock.3} (94%)
 rename lib/libc/compat-43/{sigpause.2 => sigpause.3} (94%)
 rename lib/libc/compat-43/{sigsetmask.2 => sigsetmask.3} (93%)
 rename lib/libc/compat-43/{sigvec.2 => sigvec.3} (97%)
 rename lib/libc/{compat-43/creat.2 => gen/creat.3} (95%)
 rename lib/libc/{compat-43 => gen}/creat.c (95%)
 rename lib/libc/{compat-43 => gen}/gethostid.3 (96%)
 rename lib/libc/{compat-43 => gen}/gethostid.c (95%)
 rename lib/libc/{compat-43/killpg.2 => gen/killpg.3} (96%)
 rename lib/libc/{compat-43 => gen}/killpg.c (95%)

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index 7d32f6f..33d3794 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3137,6 +3137,13 @@ TO_REMOVE+=/usr/lib/libprivate_panelw.so.60
 TO_REMOVE+=/usr/lib/profile/libprivate_panel.a
 TO_REMOVE+=/usr/lib/profile/libprivate_panelw.a
 TO_REMOVE+=/usr/include/compat
+TO_REMOVE+=/usr/share/man/man2/creat.2.gz
+TO_REMOVE+=/usr/share/man/man2/killpg.2.gz
+TO_REMOVE+=/usr/share/man/man2/setpgrp.2.gz
+TO_REMOVE+=/usr/share/man/man2/sigblock.2.gz
+TO_REMOVE+=/usr/share/man/man2/sigpause.2.gz
+TO_REMOVE+=/usr/share/man/man2/sigsetmask.2.gz
+TO_REMOVE+=/usr/share/man/man2/sigvec.2.gz
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/lib/libc/compat-43/Makefile.inc b/lib/libc/compat-43/Makefile.inc
index df7a932..22005e3 100644
--- a/lib/libc/compat-43/Makefile.inc
+++ b/lib/libc/compat-43/Makefile.inc
@@ -1,17 +1,11 @@
 #	@(#)Makefile.inc	8.1 (Berkeley) 6/2/93
 # $FreeBSD: src/lib/libc/compat-43/Makefile.inc,v 1.9.2.1 2001/04/25 10:04:04 ru Exp $
 
-# compat-43 sources
-.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/compat-43 ${.CURDIR}/../libc/compat-43
-
-SRCS+=	creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \
-	setrgid.c setruid.c sigcompat.c
+SRCS+=	sethostid.c setpgrp.c setrgid.c setruid.c sigcompat.c
 
 .if ${LIB} == "c"
-MAN+=	creat.2 killpg.2 sigblock.2 sigpause.2 sigsetmask.2 sigvec.2
-MAN+=	gethostid.3 setruid.3
+MAN+=	sigblock.3 sigpause.3 sigsetmask.3 sigvec.3 setruid.3
 
-MLINKS+=gethostid.3 sethostid.3
 MLINKS+=setruid.3 setrgid.3
 .endif
 
diff --git a/lib/libc/compat-43/Symbol.map b/lib/libc/compat-43/Symbol.map
index 920626a..b2106d1 100644
--- a/lib/libc/compat-43/Symbol.map
+++ b/lib/libc/compat-43/Symbol.map
@@ -1,8 +1,4 @@
 DF404.0 {
-    creat;
-    gethostid;
-    getwd;
-    killpg;
     sethostid;
     setpgrp;
     setrgid;
@@ -12,8 +8,3 @@ DF404.0 {
     sigsetmask;
     sigvec;
 };
-
-DFprivate_1.0 {
-    __creat;
-    _creat;
-};
diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c
deleted file mode 100644
index e4b9cb7..0000000
--- a/lib/libc/compat-43/getwd.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)getwd.c	8.1 (Berkeley) 6/2/93
- * $DragonFly: src/lib/libc/compat-43/getwd.c,v 1.3 2005/11/12 22:35:01 swildner Exp $
- */
-
-#include <sys/param.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-char *
-getwd(char *buf)
-{
-	char *p;
-
-	if ( (p = getcwd(buf, MAXPATHLEN)) )
-		return(p);
-	strcpy(buf, strerror(errno));
-	return(NULL);
-}
diff --git a/lib/libc/compat-43/sigblock.2 b/lib/libc/compat-43/sigblock.3
similarity index 94%
rename from lib/libc/compat-43/sigblock.2
rename to lib/libc/compat-43/sigblock.3
index c124569..e16c147 100644
--- a/lib/libc/compat-43/sigblock.2
+++ b/lib/libc/compat-43/sigblock.3
@@ -27,10 +27,9 @@
 .\"
 .\"     @(#)sigblock.2	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/sigblock.2,v 1.5.2.2 2001/12/21 10:07:08 ru Exp $
-.\" $DragonFly: src/lib/libc/compat-43/sigblock.2,v 1.2 2003/06/17 04:26:41 dillon Exp $
 .\"
-.Dd June 2, 1993
-.Dt SIGBLOCK 2
+.Dd October 21, 2016
+.Dt SIGBLOCK 3
 .Os
 .Sh NAME
 .Nm sigblock
@@ -74,7 +73,7 @@ The previous set of masked signals is returned.
 .Xr kill 2 ,
 .Xr sigaction 2 ,
 .Xr sigprocmask 2 ,
-.Xr sigsetmask 2 ,
+.Xr sigsetmask 3 ,
 .Xr sigsetops 3
 .Sh HISTORY
 The
diff --git a/lib/libc/compat-43/sigpause.2 b/lib/libc/compat-43/sigpause.3
similarity index 94%
rename from lib/libc/compat-43/sigpause.2
rename to lib/libc/compat-43/sigpause.3
index e48d2a4..621f0ea 100644
--- a/lib/libc/compat-43/sigpause.2
+++ b/lib/libc/compat-43/sigpause.3
@@ -27,10 +27,9 @@
 .\"
 .\"     @(#)sigpause.2	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/sigpause.2,v 1.5.2.6 2003/03/15 15:11:05 trhodes Exp $
-.\" $DragonFly: src/lib/libc/compat-43/sigpause.2,v 1.2 2003/06/17 04:26:41 dillon Exp $
 .\"
-.Dd June 2, 1993
-.Dt SIGPAUSE 2
+.Dd October 21, 2016
+.Dt SIGPAUSE 3
 .Os
 .Sh NAME
 .Nm sigpause
@@ -68,10 +67,10 @@ set to
 .Sh SEE ALSO
 .Xr kill 2 ,
 .Xr sigaction 2 ,
-.Xr sigblock 2 ,
 .Xr sigprocmask 2 ,
 .Xr sigsuspend 2 ,
-.Xr sigvec 2
+.Xr sigblock 3
+.Xr sigvec 3
 .Sh HISTORY
 The
 .Fn sigpause
diff --git a/lib/libc/compat-43/sigsetmask.2 b/lib/libc/compat-43/sigsetmask.3
similarity index 93%
rename from lib/libc/compat-43/sigsetmask.2
rename to lib/libc/compat-43/sigsetmask.3
index 4292ac1..c2270e2 100644
--- a/lib/libc/compat-43/sigsetmask.2
+++ b/lib/libc/compat-43/sigsetmask.3
@@ -27,10 +27,9 @@
 .\"
 .\"     @(#)sigsetmask.2	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/sigsetmask.2,v 1.7.2.4 2001/12/14 18:33:49 ru Exp $
-.\" $DragonFly: src/lib/libc/compat-43/sigsetmask.2,v 1.2 2003/06/17 04:26:41 dillon Exp $
 .\"
-.Dd June 2, 1993
-.Dt SIGSETMASK 2
+.Dd October 26, 2016
+.Dt SIGSETMASK 3
 .Os
 .Sh NAME
 .Nm sigsetmask
@@ -69,11 +68,11 @@ The previous set of masked signals is returned.
 .Sh SEE ALSO
 .Xr kill 2 ,
 .Xr sigaction 2 ,
-.Xr sigblock 2 ,
 .Xr sigprocmask 2 ,
 .Xr sigsuspend 2 ,
-.Xr sigvec 2 ,
-.Xr sigsetops 3
+.Xr sigblock 3 ,
+.Xr sigsetops 3 ,
+.Xr sigvec 3
 .Sh HISTORY
 The
 .Fn sigsetmask
diff --git a/lib/libc/compat-43/sigvec.2 b/lib/libc/compat-43/sigvec.3
similarity index 97%
rename from lib/libc/compat-43/sigvec.2
rename to lib/libc/compat-43/sigvec.3
index 29b4de8..b7224b8 100644
--- a/lib/libc/compat-43/sigvec.2
+++ b/lib/libc/compat-43/sigvec.3
@@ -27,9 +27,8 @@
 .\"
 .\"     @(#)sigvec.2	8.2 (Berkeley) 4/19/94
 .\" $FreeBSD: src/lib/libc/compat-43/sigvec.2,v 1.9.2.8 2003/03/15 15:11:05 trhodes Exp $
-.\" $DragonFly: src/lib/libc/compat-43/sigvec.2,v 1.4 2006/05/26 19:39:36 swildner Exp $
 .\"
-.Dd April 19, 1994
+.Dd October 21, 2016
 .Dt SIGVEC 2
 .Os
 .Sh NAME
@@ -82,9 +81,9 @@ defines the set of signals currently blocked from delivery
 to a process.  The signal mask for a process is initialized
 from that of its parent (normally 0).  It
 may be changed with a
-.Xr sigblock 2
+.Xr sigblock 3
 or
-.Xr sigsetmask 2
+.Xr sigsetmask 3
 call, or when a signal is delivered to the process.
 .Pp
 When a signal
@@ -104,9 +103,9 @@ must arrange to restore the previous context itself.
 When a signal is delivered to a process a new signal mask is
 installed for the duration of the process' signal handler
 (or until a
-.Xr sigblock 2
+.Xr sigblock 3
 or
-.Xr sigsetmask 2
+.Xr sigsetmask 3
 call is made).
 This mask is formed by taking the current signal mask,
 adding the signal to be delivered, and
@@ -321,14 +320,14 @@ or
 .Xr ptrace 2 ,
 .Xr sigaction 2 ,
 .Xr sigaltstack 2 ,
-.Xr sigblock 2 ,
-.Xr sigpause 2 ,
 .Xr sigprocmask 2 ,
-.Xr sigsetmask 2 ,
 .Xr sigsuspend 2 ,
 .Xr setjmp 3 ,
+.Xr sigblock 3 ,
 .Xr siginterrupt 3 ,
 .Xr signal 3 ,
+.Xr sigpause 3 ,
+.Xr sigsetmask 3 ,
 .Xr sigsetops 3 ,
 .Xr tty 4
 .Sh BUGS
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index af22373..7aa4851 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -10,19 +10,19 @@ CMAPS+=	${.CURDIR}/gen/Symbol.map
 
 SRCS+=  _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \
 	_thread_init.c alarm.c arc4random.c assert.c basename.c \
-	clock.c closedir.c confstr.c \
+	clock.c closedir.c confstr.c creat.c \
 	ctermid.c daemon.c devname.c dirfd.c dirname.c disklabel.c disktab.c \
 	dlfcn.c drand48.c elf_utils.c erand48.c err.c errlst.c exec.c \
 	fdevname.c fmtcheck.c fmtmsg.c fnmatch.c fpclassify.c \
 	frexp.c fstab.c ftok.c fts.c ftw.c getbootfile.c getbsize.c \
 	getcap.c getcwd.c getdevpath.c getdomainname.c \
-	getgrent.c getgrouplist.c \
-	gethostname.c getloadavg.c getlogin.c getmntinfo.c getmntvinfo.c \
+	getgrent.c getgrouplist.c gethostid.c gethostname.c \
+	getloadavg.c getlogin.c getmntinfo.c getmntvinfo.c \
 	getnetgrent.c getobjformat.c getosreldate.c getpagesize.c \
 	getpeereid.c getprogname.c getpwent.c getttyent.c \
 	getusershell.c getvfsbyname.c getvfsent.c glob.c \
 	initgroups.c isatty.c isinf.c isfinite.c isnan.c isnormal.c \
-	jrand48.c lcong48.c ldexp.c libc_dlopen.c \
+	jrand48.c killpg.c lcong48.c ldexp.c libc_dlopen.c \
 	lockf.c lrand48.c modf.c mrand48.c sysvipc_msgctl.c \
 	sysvipc_msgget.c sysvipc_msgrcv.c sysvipc_msgsnd.c nftw.c nice.c \
 	nlist.c nrand48.c ntp_gettime.c opendir.c \
@@ -53,21 +53,20 @@ SRCS+=	tls.c
 .if ${LIB} == "c"
 MAN+=	alarm.3 arc4random.3 clock.3 \
 	basename.3 \
-	confstr.3 ctermid.3 daemon.3 \
+	confstr.3 creat.3 ctermid.3 daemon.3 \
 	devname.3 directory.3 dirname.3 \
 	dladdr.3 dlinfo.3 dlopen.3 \
 	dlclose.3 dlerror.3 dlfcn.3 dlsym.3 dlvsym.3 dl_iterate_phdr.3 \
 	endutxent.3 err.3 exec.3 \
 	fmtcheck.3 fmtmsg.3 fnmatch.3 fpclassify.3 frexp.3 ftok.3 fts.3 ftw.3 \
 	getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \
-	getdevpath.3 \
-	getdiskbyname.3 getdisktabbyname.3 getdomainname.3 getfsent.3 \
-	getgrent.3 getgrouplist.3 gethostname.3 getlastlogx.3 getloadavg.3 \
+	getdevpath.3 getdiskbyname.3 getdisktabbyname.3 getdomainname.3 \
+	getfsent.3 getgrent.3 getgrouplist.3 \
+	gethostid.3 gethostname.3 getlastlogx.3 getloadavg.3 \
 	getmntinfo.3 getnetgrent.3 getobjformat.3 getosreldate.3 \
 	getpagesize.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \
 	getttyent.3 getusershell.3 getvfsbyname.3 getvfsent.3 \
-	glob.3 initgroups.3 \
-	isgreater.3 \
+	glob.3 initgroups.3 isgreater.3 killpg.3 \
 	ldexp.3 lockf.3 makecontext.3 makecontext_quick.3 modf.3 \
 	nice.3 nlist.3 pause.3 popen.3 posix_spawn.3 \
 	posix_spawn_file_actions_addopen.3 posix_spawn_file_actions_init.3 \
@@ -124,6 +123,7 @@ MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \
 MLINKS+=getgrent.3 endgrent.3 getgrent.3 getgrent_r.3 getgrent.3 getgrgid.3 \
 	getgrent.3 getgrgid_r.3 getgrent.3 getgrnam.3 getgrent.3 getgrnam_r.3 \
 	getgrent.3 setgrent.3 getgrent.3 setgroupent.3
+MLINKS+=gethostid.3 sethostid.3
 MLINKS+=gethostname.3 sethostname.3
 MLINKS+=getlastlogx.3 updlastlogx.3 getlastlogx.3 getutmp.3 \
 	getlastlogx.3 getutmpx.3 getlastlogx.3 updwtmpx.3 \
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 8e94912..f8810a0 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -214,6 +214,7 @@ DF404.0 {
     closedir;
     closelog;
     confstr;
+    creat;
     ctermid;
     ctermid_r;
     daemon;
@@ -280,6 +281,7 @@ DF404.0 {
     getgrnam;
     getgrnam_r;
     getgrouplist;
+    gethostid;
     gethostname;
     getloadavg;
     getlogin_r;
@@ -305,6 +307,7 @@ DF404.0 {
     getvfsbyname;
     getvfsbytype;
     getvfsent;
+    getwd;
     glob;
     globfree;
     group_from_gid;
@@ -317,6 +320,7 @@ DF404.0 {
     isnanf;
     isnettty;
     jrand48;
+    killpg;
     lcong48;
     ldexp;
     lockf;
@@ -618,6 +622,7 @@ DFprivate_1.0 {
     _rtld_free_tls;
 
 	/* remaining private functions */
+    __creat;
     __elf_phdr_match_addr;
     __fdnlist;
     __fdopendir2;
@@ -630,6 +635,7 @@ DFprivate_1.0 {
     __usleep;
     __wait;
     __waitpid;
+    _creat;
     _err;
     _readdir_unlocked;
     _reclaim_telldir;
diff --git a/lib/libc/compat-43/creat.2 b/lib/libc/gen/creat.3
similarity index 95%
rename from lib/libc/compat-43/creat.2
rename to lib/libc/gen/creat.3
index d69b6a8..7edad3f 100644
--- a/lib/libc/compat-43/creat.2
+++ b/lib/libc/gen/creat.3
@@ -27,10 +27,9 @@
 .\"
 .\"     @(#)creat.2	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/creat.2,v 1.6.2.4 2003/03/15 15:11:05 trhodes Exp $
-.\" $DragonFly: src/lib/libc/compat-43/creat.2,v 1.2 2003/06/17 04:26:41 dillon Exp $
 .\"
-.Dd June 2, 1993
-.Dt CREAT 2
+.Dd October 21, 2016
+.Dt CREAT 3
 .Os
 .Sh NAME
 .Nm creat
diff --git a/lib/libc/compat-43/creat.c b/lib/libc/gen/creat.c
similarity index 95%
rename from lib/libc/compat-43/creat.c
rename to lib/libc/gen/creat.c
index ecdf6d1..92f74d3 100644
--- a/lib/libc/compat-43/creat.c
+++ b/lib/libc/gen/creat.c
@@ -27,7 +27,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc/compat-43/creat.c,v 1.4.2.2 2001/03/05 07:28:35 obrien Exp $
- * $DragonFly: src/lib/libc/compat-43/creat.c,v 1.4 2005/04/26 10:25:55 joerg Exp $
  *
  * @(#)creat.c	8.1 (Berkeley) 6/2/93
  */
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index 84ec439..3b3fe21 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -27,12 +27,12 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc/gen/getcwd.c,v 1.18 1999/09/28 13:24:13 marcel Exp $
- * $DragonFly: src/lib/libc/gen/getcwd.c,v 1.6 2005/04/26 06:04:56 joerg Exp $
  *
  * @(#)getcwd.c	8.5 (Berkeley) 2/7/95
  */
 
 #include <sys/param.h>
+#include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -59,3 +59,14 @@ getcwd(char *pt, size_t size)
 		free(pt);
 	return (NULL);
 }
+
+char *
+getwd(char *buf)
+{
+	char *p;
+
+	if ((p = getcwd(buf, MAXPATHLEN)) != 0)
+		return(p);
+	strcpy(buf, strerror(errno));
+	return(NULL);
+}
diff --git a/lib/libc/compat-43/gethostid.3 b/lib/libc/gen/gethostid.3
similarity index 96%
rename from lib/libc/compat-43/gethostid.3
rename to lib/libc/gen/gethostid.3
index 4be8888..0a209d4 100644
--- a/lib/libc/compat-43/gethostid.3
+++ b/lib/libc/gen/gethostid.3
@@ -27,7 +27,6 @@
 .\"
 .\"     @(#)gethostid.3	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/gethostid.3,v 1.5.2.6 2003/03/15 15:11:05 trhodes Exp $
-.\" $DragonFly: src/lib/libc/compat-43/gethostid.3,v 1.4 2007/07/30 22:11:32 swildner Exp $
 .\"
 .Dd June 2, 1993
 .Dt GETHOSTID 3
diff --git a/lib/libc/compat-43/gethostid.c b/lib/libc/gen/gethostid.c
similarity index 95%
rename from lib/libc/compat-43/gethostid.c
rename to lib/libc/gen/gethostid.c
index deb3c93..bbc20eb 100644
--- a/lib/libc/compat-43/gethostid.c
+++ b/lib/libc/gen/gethostid.c
@@ -27,7 +27,6 @@
  * SUCH DAMAGE.
  *
  * @(#)gethostid.c	8.1 (Berkeley) 6/2/93
- * $DragonFly: src/lib/libc/compat-43/gethostid.c,v 1.3 2005/04/26 10:26:41 joerg Exp $
  */
 
 #include <sys/types.h>
diff --git a/lib/libc/compat-43/killpg.2 b/lib/libc/gen/killpg.3
similarity index 96%
rename from lib/libc/compat-43/killpg.2
rename to lib/libc/gen/killpg.3
index 2e63604..5bc8b40 100644
--- a/lib/libc/compat-43/killpg.2
+++ b/lib/libc/gen/killpg.3
@@ -27,10 +27,9 @@
 .\"
 .\"     @(#)killpg.2	8.1 (Berkeley) 6/2/93
 .\" $FreeBSD: src/lib/libc/compat-43/killpg.2,v 1.6.2.4 2003/03/15 15:11:05 trhodes Exp $
-.\" $DragonFly: src/lib/libc/compat-43/killpg.2,v 1.3 2007/09/08 20:50:49 swildner Exp $
 .\"
-.Dd June 2, 1993
-.Dt KILLPG 2
+.Dd October 21, 2016
+.Dt KILLPG 3
 .Os
 .Sh NAME
 .Nm killpg
diff --git a/lib/libc/compat-43/killpg.c b/lib/libc/gen/killpg.c
similarity index 95%
rename from lib/libc/compat-43/killpg.c
rename to lib/libc/gen/killpg.c
index 39246b5..43f5f0f 100644
--- a/lib/libc/compat-43/killpg.c
+++ b/lib/libc/gen/killpg.c
@@ -27,7 +27,6 @@
  * SUCH DAMAGE.
  *
  * @(#)killpg.c	8.1 (Berkeley) 6/2/93
- * $DragonFly: src/lib/libc/compat-43/killpg.c,v 1.3 2005/11/12 22:35:01 swildner Exp $
  */
 
 #include <sys/types.h>
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index a52da3c..158535a 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -177,7 +177,7 @@ MLINKS+=semctl.2 semctl.3
 MLINKS+=semget.2 semget.3
 MLINKS+=semop.2 semop.3
 MLINKS+=send.2 sendmsg.2 send.2 sendto.2
-MLINKS+=setpgid.2 setpgrp.2
+MLINKS+=setpgid.2 setpgrp.3
 MLINKS+=setresuid.2 getresgid.2 setresuid.2 getresuid.2 setresuid.2 setresgid.2
 MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2
 MLINKS+=shmat.2 shmat.3 \
diff --git a/lib/libc/sys/kill.2 b/lib/libc/sys/kill.2
index a981875..a9baa63 100644
--- a/lib/libc/sys/kill.2
+++ b/lib/libc/sys/kill.2
@@ -27,7 +27,6 @@
 .\"
 .\"     @(#)kill.2	8.3 (Berkeley) 4/19/94
 .\" $FreeBSD: src/lib/libc/sys/kill.2,v 1.10.2.7 2001/12/14 18:34:01 ru Exp $
-.\" $DragonFly: src/lib/libc/sys/kill.2,v 1.4 2007/12/08 23:20:29 swildner Exp $
 .\"
 .Dd April 19, 1994
 .Dt KILL 2
@@ -80,7 +79,7 @@ is sent to all processes whose group ID is equal
 to the process group ID of the sender, and for which the
 process has permission;
 this is a variant of
-.Xr killpg 2 .
+.Xr killpg 3 .
 .It \&If Fa pid No \&is -1 :
 If the user has super-user privileges,
 the signal is sent to all processes excluding
@@ -102,7 +101,7 @@ if the process number is negative but not -1,
 the signal is sent to all processes whose process group ID
 is equal to the absolute value of the process number.
 This is a variant of
-.Xr killpg 2 .
+.Xr killpg 3 .
 .Sh RETURN VALUES
 .Rv -std kill
 .Sh ERRORS
@@ -127,9 +126,9 @@ of the group could not be signaled.
 .Sh SEE ALSO
 .Xr getpgrp 2 ,
 .Xr getpid 2 ,
-.Xr killpg 2 ,
 .Xr lwp_kill 2 ,
 .Xr sigaction 2 ,
+.Xr killpg 3 ,
 .Xr raise 3 ,
 .Xr init 8
 .Sh STANDARDS
diff --git a/lib/libutil/uucplock.3 b/lib/libutil/uucplock.3
index 324befa..9acd30a 100644
--- a/lib/libutil/uucplock.3
+++ b/lib/libutil/uucplock.3
@@ -104,7 +104,7 @@ The lock file could not be read via
 .Pp
 .Dv UU_LOCK_CREAT_ERR :
 Cannot create temporary lock file via
-.Xr creat 2 .
+.Xr creat 3 .
 .Pp
 .Dv UU_LOCK_WRITE_ERR :
 The current process id could not be written to the lock file via a call to
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
index fcac54c..0edc043 100644
--- a/sys/sys/fcntl.h
+++ b/sys/sys/fcntl.h
@@ -259,12 +259,12 @@ int	open(const char *, int, ...);
 #if __POSIX_VISIBLE >= 200809
 int	openat(int, const char *, int, ...);
 #endif
-int	creat(const char *, mode_t);
 int	fcntl(int, int, ...);
 #if __BSD_VISIBLE
 int	flock(int, int);
 #endif /* __BSD_VISIBLE */
 __END_DECLS
+int	creat(const char *, mode_t);
 #endif
 
 #endif /* !_SYS_FCNTL_H_ */
-- 
2.9.2

