diff options
author | Roland McGrath <roland@gnu.org> | 2000-03-13 07:09:36 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2000-03-13 07:09:36 +0000 |
commit | 5471f96e2f27924f2e55e379f4a6159e45a12a32 (patch) | |
tree | 090fa3938b35627144ba6ae57467de045af5e799 /exec/priv.h | |
parent | 63c2d86136db34b607ade96974565ed7d70532d6 (diff) |
2000-03-13 Roland McGrath <roland@baalperazim.frob.com>
* exec.c (map): Made global.
* priv.h: Declare it.
(map_fsize, map_vsize): New macros for accessing state set up by map.
* hashexec.c (check_hashbang): Use map and copying operations rather
than stdio to extract the first line from the file. Move finish call
to immediately after reading the line.
Diffstat (limited to 'exec/priv.h')
-rw-r--r-- | exec/priv.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/exec/priv.h b/exec/priv.h index f6889b32..75a350f1 100644 --- a/exec/priv.h +++ b/exec/priv.h @@ -1,5 +1,5 @@ /* GNU Hurd standard exec server, private declarations. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright (C) 1992,93,94,95,96,99,2000 Free Software Foundation, Inc. Written by Roland McGrath. This file is part of the GNU Hurd. @@ -85,12 +85,19 @@ struct execdata /* Set by check. */ vm_address_t entry; - FILE stream; file_t file; +#ifdef _STDIO_USES_IOSTREAM +#else + FILE stream; +#define map_fsize(e) ((e)->stream.__get_limit - (e)->stream.__buffer) +#define map_vsize(e) ((e)->stream.__bufsize) +#endif + #ifdef BFD bfd *bfd; #endif + union /* Interpreter section giving name of file. */ { asection *section; @@ -128,6 +135,12 @@ error_t elf_machine_matches_host (Elf32_Half e_machine); void finish (struct execdata *, int dealloc_file_port); +/* Make sure our mapping window (or read buffer) covers + LEN bytes of the file starting at POSN. */ +void *map (struct execdata *e, off_t posn, size_t len); + + + void check_hashbang (struct execdata *e, file_t file, task_t oldtask, |