Fixes to build rump utilities as host binaries on Linux by removing
sys namespace pollution which has crept in. Submitted in private mail by takemura, domain ca2.so-net.ne.jp
This commit is contained in:
parent
94bc3febe6
commit
d2e855d5a6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ukfs.c,v 1.27 2008/06/24 14:16:37 pooka Exp $ */
|
||||
/* $NetBSD: ukfs.c,v 1.28 2008/07/01 12:33:32 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -33,20 +33,21 @@
|
|||
* involving system calls.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/uio.h>
|
||||
#ifdef __linux__
|
||||
#define _XOPEN_SOURCE 500
|
||||
#define _BSD_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rump_syscalls.h"
|
||||
|
@ -248,8 +249,8 @@ ukfs_getdents(struct ukfs *ukfs, const char *dirname, off_t *off,
|
|||
size_t resid;
|
||||
int rv, eofflag;
|
||||
|
||||
rv = ukfs_ll_namei(ukfs, RUMP_NAMEI_LOOKUP, NAMEI_LOCKLEAF, dirname,
|
||||
NULL, &vp, NULL);
|
||||
rv = ukfs_ll_namei(ukfs, RUMP_NAMEI_LOOKUP, RUMP_NAMEI_LOCKLEAF,
|
||||
dirname, NULL, &vp, NULL);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
|
@ -277,7 +278,7 @@ ukfs_read(struct ukfs *ukfs, const char *filename, off_t off,
|
|||
ssize_t xfer = -1; /* XXXgcc */
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, O_RDONLY, 0, &rv);
|
||||
fd = rump_sys_open(filename, RUMP_O_RDONLY, 0, &rv);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
|
@ -301,7 +302,7 @@ ukfs_write(struct ukfs *ukfs, const char *filename, off_t off,
|
|||
ssize_t xfer = -1; /* XXXgcc */
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, O_WRONLY, 0, &rv);
|
||||
fd = rump_sys_open(filename, RUMP_O_WRONLY, 0, &rv);
|
||||
if (rv)
|
||||
goto out;
|
||||
|
||||
|
@ -323,7 +324,7 @@ ukfs_create(struct ukfs *ukfs, const char *filename, mode_t mode)
|
|||
int rv, fd, dummy;
|
||||
|
||||
precall(ukfs);
|
||||
fd = rump_sys_open(filename, O_WRONLY | O_CREAT, mode, &rv);
|
||||
fd = rump_sys_open(filename, RUMP_O_WRONLY | RUMP_O_CREAT, mode, &rv);
|
||||
rump_sys_close(fd, &dummy);
|
||||
|
||||
postcall(ukfs);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.37 2008/06/30 20:14:42 matt Exp $
|
||||
# $NetBSD: Makefile,v 1.38 2008/07/01 12:33:32 pooka Exp $
|
||||
#
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
@ -65,8 +65,10 @@ rumpvnode_if.c: vnode_if.c
|
|||
# clue how to make it work in a Makefile
|
||||
sed ${VOPTORUMPVOP}";/sys\/vnode.h/{x;s/.*/${RVNH}/;x;G;n;}" \
|
||||
< ${NETBSDSRCDIR}/sys/kern/vnode_if.c > rumpvnode_if.c
|
||||
sed -n '/define/s/NAMEI_/RUMP_NAMEI_/p' \
|
||||
sed -n '/#define NAMEI_/s/NAMEI_/RUMP_NAMEI_/gp' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/namei.h > rumpdefs.h
|
||||
sed -n '/#define O_[A-Z]* *0x/s/O_/RUMP_O_/gp' \
|
||||
< ${NETBSDSRCDIR}/sys/sys/fcntl.h >> rumpdefs.h
|
||||
printf "#ifndef __VTYPE_DEFINED\n#define __VTYPE_DEFINED\n" \
|
||||
>> rumpdefs.h
|
||||
sed -n '/enum vtype.*{/p' \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: auth.c,v 1.8 2008/06/23 12:58:12 pooka Exp $ */
|
||||
/* $NetBSD: auth.c,v 1.9 2008/07/01 12:33:32 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sys/errno.h>
|
||||
#include <sys/kauth.h>
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include "rump.h"
|
||||
#include "rumpuser.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump.h,v 1.27 2008/06/06 10:46:35 pooka Exp $ */
|
||||
/* $NetBSD: rump.h,v 1.28 2008/07/01 12:33:32 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -30,16 +30,13 @@
|
|||
#ifndef _SYS_RUMP_H_
|
||||
#define _SYS_RUMP_H_
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
struct mount;
|
||||
struct vnode;
|
||||
struct vattr;
|
||||
struct componentname;
|
||||
struct vfsops;
|
||||
struct fid;
|
||||
struct statvfs;
|
||||
|
||||
#if !defined(_RUMPKERNEL) && !defined(__NetBSD__)
|
||||
struct kauth_cred;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: specfs.c,v 1.19 2008/01/27 19:07:22 pooka Exp $ */
|
||||
/* $NetBSD: specfs.c,v 1.20 2008/07/01 12:33:32 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include <sys/vnode_if.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <miscfs/genfs/genfs.h>
|
||||
#include <miscfs/specfs/specdev.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.c,v 1.16 2008/06/24 14:14:57 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.c,v 1.17 2008/07/01 12:33:33 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -45,11 +45,7 @@
|
|||
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.h,v 1.18 2008/06/24 14:14:57 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.h,v 1.19 2008/07/01 12:33:33 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -30,9 +30,7 @@
|
|||
#ifndef _SYS_RUMPUSER_H_
|
||||
#define _SYS_RUMPUSER_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/proc.h>
|
||||
struct stat;
|
||||
|
||||
int rumpuser_stat(const char *, struct stat *, int *);
|
||||
int rumpuser_lstat(const char *, struct stat *, int *);
|
||||
|
@ -108,6 +106,8 @@ int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *, int);
|
|||
void rumpuser_cv_signal(struct rumpuser_cv *);
|
||||
void rumpuser_cv_broadcast(struct rumpuser_cv *);
|
||||
|
||||
struct lwp;
|
||||
|
||||
void rumpuser_set_curlwp(struct lwp *);
|
||||
struct lwp *rumpuser_get_curlwp(void);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser_pth.c,v 1.12 2008/03/11 10:50:16 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser_pth.c,v 1.13 2008/07/01 12:33:33 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -28,8 +28,11 @@
|
|||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/lwp.h>
|
||||
#ifdef __linux__
|
||||
#define _XOPEN_SOURCE 500
|
||||
#define _BSD_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
@ -37,6 +40,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "rumpuser.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue