This commit is contained in:
matt 2006-08-30 11:35:21 +00:00
parent 0cf3f9db4e
commit 984109dc99
7 changed files with 103 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_sysent.c,v 1.178 2006/08/29 23:37:30 matt Exp $ */
/* $NetBSD: init_sysent.c,v 1.179 2006/08/30 11:35:21 matt Exp $ */
/*
* System call switch table.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.178 2006/08/29 23:37:30 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.179 2006/08/30 11:35:21 matt Exp $");
#include "opt_ktrace.h"
#include "opt_nfsserver.h"
@ -157,7 +157,7 @@ struct sysent sysent[] = {
#endif
{ 0, 0, 0,
sys_geteuid }, /* 25 = geteuid */
#ifdef PTRACE
#if defined(KTRACE) || !defined(_KERNEL)
{ 4, s(struct sys_ptrace_args), 0,
sys_ptrace }, /* 26 = ptrace */
#else

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscalls.c,v 1.174 2006/08/29 23:37:30 matt Exp $ */
/* $NetBSD: syscalls.c,v 1.175 2006/08/30 11:35:21 matt Exp $ */
/*
* System call names.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.174 2006/08/29 23:37:30 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.175 2006/08/30 11:35:21 matt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ktrace.h"
@ -63,7 +63,7 @@ const char *const syscallnames[] = {
"getuid", /* 24 = getuid */
#endif
"geteuid", /* 25 = geteuid */
#ifdef PTRACE
#if defined(KTRACE) || !defined(_KERNEL)
"ptrace", /* 26 = ptrace */
#else
"#26 (excluded ktrace)", /* 26 = excluded ktrace */

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.h,v 1.113 2006/05/14 21:38:18 elad Exp $ */
/* $NetBSD: exec.h,v 1.114 2006/08/30 11:35:21 matt Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -221,6 +221,7 @@ struct exec_vmcmd {
#define VMCMD_RELATIVE 0x0001 /* ev_addr is relative to base entry */
#define VMCMD_BASE 0x0002 /* marks a base entry */
#define VMCMD_FIXED 0x0004 /* entry must be mapped at ev_addr */
#define VMCMD_STACK 0x0008 /* entry is for a stack */
};
#ifdef _KERNEL

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec_elf.h,v 1.86 2006/05/16 00:08:25 elad Exp $ */
/* $NetBSD: exec_elf.h,v 1.87 2006/08/30 11:35:21 matt Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -53,6 +53,14 @@
#include <inttypes.h>
#endif /* _KERNEL || _STANDALONE */
#if defined(ELFSIZE)
#define CONCAT(x,y) __CONCAT(x,y)
#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE))
#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
#endif
#include <machine/elf_machdep.h>
typedef uint8_t Elf_Byte;
@ -385,6 +393,9 @@ typedef struct {
#define SHT_NUM 12
#define SHT_LOOS 0x60000000 /* Operating system specific range */
#define SHT_SUNW_VERDEF 0x6ffffffd /* Versions defined by file */
#define SHT_SUNW_VERNEED 0x6ffffffe /* Versions needed by file */
#define SHT_SUNW_VERSYM 0x6fffffff /* Symbol versions */
#define SHT_HIOS 0x6fffffff
#define SHT_LOPROC 0x70000000 /* Processor-specific range */
#define SHT_HIPROC 0x7fffffff
@ -569,6 +580,11 @@ typedef struct {
#define DT_NUM 29
#define DT_LOOS 0x60000000 /* Operating system specific range */
#define DT_VERSYM 0x6ffffff0 /* Symbol versions */
#define DT_VERDEF 0x6ffffffc /* Versions defined by file */
#define DT_VERDEFNUM 0x6ffffffd /* Number of versions defined by file */
#define DT_VERNEED 0x6ffffffe /* Versions needed by file */
#define DT_VERNEEDNUM 0x6fffffff /* Number of versions needed by file */
#define DT_HIOS 0x6fffffff
#define DT_LOPROC 0x70000000 /* Processor-specific range */
#define DT_HIPROC 0x7fffffff
@ -725,14 +741,6 @@ struct netbsd_elfcore_procinfo {
int32_t cpi_siglwp; /* LWP target of killing signal */
};
#if defined(ELFSIZE)
#define CONCAT(x,y) __CONCAT(x,y)
#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE))
#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
#endif
#if defined(ELFSIZE) && (ELFSIZE == 32)
#define Elf_Ehdr Elf32_Ehdr
#define Elf_Phdr Elf32_Phdr
@ -823,6 +831,77 @@ struct elf_args {
};
#endif
/*
* These constants are used for Elf32_Verdef struct's version number.
*/
#define VER_DEF_NONE 0
#define VER_DEF_CURRENT 1
/*
* These constants are used for Elf32_Verdef struct's vd_flags.
*/
#define VER_FLG_BASE 0x1
#define VER_FLG_WEAK 0x2
/*
* These are used in an Elf32_Versym field.
*/
#define VER_NDX_LOCAL 0
#define VER_NDX_GLOBAL 1
/*
* These constants are used for Elf32_Verneed struct's version number.
*/
#define VER_NEED_NONE 0
#define VER_NEED_CURRENT 1
/*
* GNU Extension hidding symb
*/
#define VERSYM_HIDDEN 0x8000
#define VERSYM_VERSION 0x7fff
#define ELF_VER_CHR '@'
/*
* These are current size independent.
*/
typedef struct {
Elf32_Half vd_version; /* version number of structure */
Elf32_Half vd_flags; /* flags (VER_FLG_*) */
Elf32_Half vd_ndx; /* version index */
Elf32_Half vd_cnt; /* number of verdaux entries */
Elf32_Word vd_hash; /* hash of name */
Elf32_Word vd_aux; /* offset to verdaux entries */
Elf32_Word vd_next; /* offset to next verdef */
} Elf32_Verdef;
typedef struct {
Elf32_Word vda_name; /* string table offset of name */
Elf32_Word vda_next; /* offset to verdaux */
} Elf32_Verdaux;
typedef struct {
Elf32_Half vn_version; /* version number of structure */
Elf32_Half vn_cnt; /* number of vernaux entries */
Elf32_Word vn_file; /* string table offset of library name*/
Elf32_Word vn_aux; /* offset to vernaux entries */
Elf32_Word vn_next; /* offset to next verneed */
} Elf32_Verneed;
typedef struct {
Elf32_Word vna_hash; /* Hash of dependency name */
Elf32_Half vna_flags; /* flags (VER_FLG_*) */
Elf32_Half vna_other; /* unused */
Elf32_Word vna_name; /* string table offset to version name*/
Elf32_Word vna_next; /* offset to next vernaux */
} Elf32_Vernaux;
typedef struct {
Elf32_Half vs_vers;
} Elf32_Versym;
#ifndef _LKM
#include "opt_execfmt.h"
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: mman.h,v 1.37 2005/12/11 12:25:20 christos Exp $ */
/* $NetBSD: mman.h,v 1.38 2006/08/30 11:35:21 matt Exp $ */
/*-
* Copyright (c) 1982, 1986, 1993
@ -95,6 +95,7 @@ typedef __off_t off_t; /* file offset */
*/
#define MAP_FILE 0x0000 /* map from file (default) */
#define MAP_ANON 0x1000 /* allocated from memory, swap space */
#define MAP_STACK 0x2000 /* allocated from memory, swap space (stack) */
/*
* Alignment (expressed in log2). Must be >= log2(PAGE_SIZE) and

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.h,v 1.171 2006/08/29 23:38:54 matt Exp $ */
/* $NetBSD: syscall.h,v 1.172 2006/08/30 11:35:21 matt Exp $ */
/*
* System call numbers.
@ -98,7 +98,7 @@
/* syscall: "geteuid" ret: "uid_t" args: */
#define SYS_geteuid 25
#ifdef PTRACE
#if defined(KTRACE) || !defined(_KERNEL)
/* syscall: "ptrace" ret: "int" args: "int" "pid_t" "caddr_t" "int" */
#define SYS_ptrace 26

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscallargs.h,v 1.153 2006/08/29 23:38:54 matt Exp $ */
/* $NetBSD: syscallargs.h,v 1.154 2006/08/30 11:35:21 matt Exp $ */
/*
* System call argument lists.
@ -136,7 +136,7 @@ struct sys_setuid_args {
#ifdef COMPAT_43
#else
#endif
#ifdef PTRACE
#if defined(KTRACE) || !defined(_KERNEL)
struct sys_ptrace_args {
syscallarg(int) req;
@ -1799,7 +1799,7 @@ int sys_getuid(struct lwp *, void *, register_t *);
#endif
int sys_geteuid(struct lwp *, void *, register_t *);
#ifdef PTRACE
#if defined(KTRACE) || !defined(_KERNEL)
int sys_ptrace(struct lwp *, void *, register_t *);
#else