Skip to content

Commit 8d4544a

Browse files
author
dsl
committed
Change libc system callstub from 'mount' to '__mount50', add compat call.
1 parent c26584f commit 8d4544a

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

lib/libc/compat/sys/Makefile.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# $NetBSD: Makefile.inc,v 1.6 2006/07/31 16:34:42 martin Exp $
1+
# $NetBSD: Makefile.inc,v 1.7 2007/07/14 15:53:04 dsl Exp $
22

33
.PATH: ${COMPATDIR}/sys
44
SRCS+= compat_getdents.c compat_getdirentries.c compat_msync.c \
55
compat_ntp_gettime.c \
66
compat_semctl.c compat_sigaltstack.c compat_stat.c compat___stat13.c \
77
compat_statfs.c compat_socket.c compat_getfh.c \
8-
compat_fhopen.c compat___fhstat30.c compat_fhstatvfs.c compat_fhstatvfs1.c
8+
compat_fhopen.c compat___fhstat30.c compat_fhstatvfs.c compat_fhstatvfs1.c \
9+
compat_mount.c
910
MAN+= getdirentries.3
1011

1112
.if ${MKLINT} != "no"

lib/libc/compat/sys/compat_mount.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* $NetBSD: compat_mount.c,v 1.1 2007/07/14 15:53:04 dsl Exp $ */
2+
3+
4+
#include <sys/cdefs.h>
5+
#if defined(LIBC_SCCS) && !defined(lint)
6+
__RCSID("$NetBSD: compat_mount.c,v 1.1 2007/07/14 15:53:04 dsl Exp $");
7+
#endif /* LIBC_SCCS and not lint */
8+
9+
#define __LIBC12_SOURCE__
10+
11+
#include <sys/types.h>
12+
#include <sys/mount.h>
13+
14+
__warn_references(mount,
15+
"warning: reference to compatibility mount(); include <sys/mount.h> to generate correct reference")
16+
17+
int mount(const char *, const char *, int, void *);
18+
int __mount50(const char *, const char *, int, void *, size_t);
19+
20+
/*
21+
* Convert old mount() call to new calling convention
22+
* The kernel will treat length 0 as 'default for the fs'.
23+
*/
24+
int
25+
mount(const char *type, const char *dir, int flags, void *data)
26+
{
27+
return __mount50(type, dir, flags, data, 0);
28+
}

lib/libc/sys/Makefile.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile.inc,v 1.174 2007/06/03 17:35:24 christos Exp $
1+
# $NetBSD: Makefile.inc,v 1.175 2007/07/14 15:53:04 dsl Exp $
22
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
33

44
# sys sources
@@ -74,8 +74,8 @@ ASM= access.S acct.S \
7474
_lwp_suspend.S _lwp_continue.S _lwp_wakeup.S _lwp_detach.S \
7575
_lwp_getprivate.S _lwp_setprivate.S \
7676
madvise.S mincore.S minherit.S mkdir.S mkfifo.S mknod.S \
77-
mlock.S mlockall.S mount.S mprotect.S __msgctl13.S msgget.S \
78-
munlock.S munlockall.S munmap.S \
77+
mlock.S mlockall.S __mount50.S mprotect.S __msgctl13.S \
78+
msgget.S munlock.S munlockall.S munmap.S \
7979
nfssvc.S __ntp_gettime30.S \
8080
pathconf.S pmc_get_info.S pmc_control.S __posix_chown.S \
8181
posix_fadvise.S \

0 commit comments

Comments
 (0)