linux_util.h (168014) | linux_util.h (177997) |
---|---|
1/*- 2 * Copyright (c) 1994 Christos Zoulas 3 * Copyright (c) 1995 Frank van der Linden 4 * Copyright (c) 1995 Scott Bartram 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp 30 * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp | 1/*- 2 * Copyright (c) 1994 Christos Zoulas 3 * Copyright (c) 1995 Frank van der Linden 4 * Copyright (c) 1995 Scott Bartram 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp 30 * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp |
31 * $FreeBSD: head/sys/compat/linux/linux_util.h 168014 2007-03-29 02:11:46Z julian $ | 31 * $FreeBSD: head/sys/compat/linux/linux_util.h 177997 2008-04-08 09:45:49Z kib $ |
32 */ 33 34/* 35 * This file is pretty much the same as Christos' svr4_util.h 36 * (for now). 37 */ 38 39#ifndef _LINUX_UTIL_H_ --- 6 unchanged lines hidden (view full) --- 46#include <sys/exec.h> 47#include <sys/sysent.h> 48#include <sys/syslog.h> 49#include <sys/cdefs.h> 50#include <sys/uio.h> 51 52extern const char linux_emul_path[]; 53 | 32 */ 33 34/* 35 * This file is pretty much the same as Christos' svr4_util.h 36 * (for now). 37 */ 38 39#ifndef _LINUX_UTIL_H_ --- 6 unchanged lines hidden (view full) --- 46#include <sys/exec.h> 47#include <sys/sysent.h> 48#include <sys/syslog.h> 49#include <sys/cdefs.h> 50#include <sys/uio.h> 51 52extern const char linux_emul_path[]; 53 |
54int linux_emul_convpath(struct thread *, char *, enum uio_seg, char **, int); | 54int linux_emul_convpath(struct thread *, const char *, enum uio_seg, char **, int, int); |
55 | 55 |
56#define LCONVPATH_SEG(td, upath, pathp, i, seg) \ | 56#define LCONVPATH_AT(td, upath, pathp, i, dfd) \ |
57 do { \ 58 int _error; \ 59 \ | 57 do { \ 58 int _error; \ 59 \ |
60 _error = linux_emul_convpath(td, upath, seg, \ 61 pathp, i); \ | 60 _error = linux_emul_convpath(td, upath, UIO_USERSPACE, \ 61 pathp, i, dfd); \ |
62 if (*(pathp) == NULL) \ 63 return (_error); \ 64 } while (0) 65 66#define LCONVPATH(td, upath, pathp, i) \ | 62 if (*(pathp) == NULL) \ 63 return (_error); \ 64 } while (0) 65 66#define LCONVPATH(td, upath, pathp, i) \ |
67 LCONVPATH_SEG(td, upath, pathp, i, UIO_USERSPACE) | 67 LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD) |
68 69#define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) | 68 69#define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) |
70#define LCONVPATHEXIST_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 0, dfd) |
|
70#define LCONVPATHCREAT(td, upath, pathp) LCONVPATH(td, upath, pathp, 1) | 71#define LCONVPATHCREAT(td, upath, pathp) LCONVPATH(td, upath, pathp, 1) |
72#define LCONVPATHCREAT_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 1, dfd) |
|
71#define LFREEPATH(path) free(path, M_TEMP) 72 73#define DUMMY(s) \ 74int \ 75linux_ ## s(struct thread *td, struct linux_ ## s ## _args *args) \ 76{ \ 77 static pid_t pid; \ 78 \ --- 29 unchanged lines hidden --- | 73#define LFREEPATH(path) free(path, M_TEMP) 74 75#define DUMMY(s) \ 76int \ 77linux_ ## s(struct thread *td, struct linux_ ## s ## _args *args) \ 78{ \ 79 static pid_t pid; \ 80 \ --- 29 unchanged lines hidden --- |