From 5471f96e2f27924f2e55e379f4a6159e45a12a32 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 13 Mar 2000 07:09:36 +0000 Subject: 2000-03-13 Roland McGrath * 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. --- exec/priv.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'exec/priv.h') 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, -- cgit v1.2.3