Module Name: src Committed By: martin Date: Wed Feb 28 18:53:06 UTC 2018
Modified Files: src/lib/librumphijack [netbsd-8]: hijack.c Log Message: Pull up following revision(s) (requested by maya in ticket #594): lib/librumphijack/hijack.c: revision 1.123 since ln(1) now uses linkat(2) provide a dumb wrapper. To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.122.4.1 src/lib/librumphijack/hijack.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.122 src/lib/librumphijack/hijack.c:1.122.4.1 --- src/lib/librumphijack/hijack.c:1.122 Thu Feb 16 08:08:01 2017 +++ src/lib/librumphijack/hijack.c Wed Feb 28 18:53:06 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $ */ +/* $NetBSD: hijack.c,v 1.122.4.1 2018/02/28 18:53:06 martin Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -34,7 +34,7 @@ #include <rump/rumpuser_port.h> #if !defined(lint) -__RCSID("$NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $"); +__RCSID("$NetBSD: hijack.c,v 1.122.4.1 2018/02/28 18:53:06 martin Exp $"); #endif #include <sys/param.h> @@ -163,6 +163,9 @@ enum dualcall { #ifdef HAVE___QUOTACTL DUALCALL_QUOTACTL, #endif +#ifdef __NetBSD__ + DUALCALL_LINKAT, +#endif DUALCALL__NUM }; @@ -379,6 +382,9 @@ struct sysnames { { DUALCALL_QUOTACTL, "__quotactl", RSYS_NAME(__QUOTACTL) }, #endif /* HAVE___QUOTACTL */ +#ifdef __NetBSD__ + { DUALCALL_LINKAT, "linkat", RSYS_NAME(LINKAT) }, +#endif }; #undef S @@ -1271,6 +1277,19 @@ moveish(const char *from, const char *to return op(from, to); } +#ifdef __NetBSD__ +int +linkat(int fromfd, const char *from, int tofd, const char *to, int flags) +{ + if (fromfd != AT_FDCWD || tofd != AT_FDCWD + || flags != AT_SYMLINK_FOLLOW) + return ENOSYS; + + return moveish(from, to, + GETSYSCALL(rump, LINK), GETSYSCALL(host, LINK)); +} +#endif + int link(const char *from, const char *to) {