diff options
author | Michael I. Bushnell <mib@gnu.org> | 1992-07-01 22:46:16 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1992-07-01 22:46:16 +0000 |
commit | 3af107776f3c5f8a293e26da76b8975d83e2af3e (patch) | |
tree | ad3949c059cc6c8c4cdc10247c3af32a2daf173a /hurd/shared.h | |
parent | 98f7b6dc1b9e01e3f1d17d2bbe8d9fab325db435 (diff) |
Formerly shared.h.~13~
Diffstat (limited to 'hurd/shared.h')
-rw-r--r-- | hurd/shared.h | 69 |
1 files changed, 58 insertions, 11 deletions
diff --git a/hurd/shared.h b/hurd/shared.h index 8244eec0..9d7edb55 100644 --- a/hurd/shared.h +++ b/hurd/shared.h @@ -1,11 +1,11 @@ /* Definitions for shared IO control pages - Copyright (C) 1991 Free Software Foundation + Copyright (C) 1992 Free Software Foundation This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) +the Free Software Foundation; either version 2, or (at your option) any later version. The GNU Hurd is distributed in the hope that it will be useful, @@ -19,10 +19,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ struct shared_io { - int shared_page_version; + int shared_page_magic; /* This lock protects against modification to it_status. */ spin_lock_t lock; + enum { USER_IT, /* User is it */ @@ -40,10 +41,29 @@ struct shared_io int do_sigio; /* call io_sigio after each operation */ int use_file_size; /* file_size is meaningful */ - off_t file_size; int use_read_size; /* read_size is meaningful */ int read_size; + + enum + { + /* This means that there isn't any data to be read */ + RBR_NO_DATA, + + /* This means that more data cannot be added to the buffer. If + the rd_file_pointer is advanced, then more data might become + readable. This condition has priority over NO_DATA: protocols + might refuse to receive data when the buffer is full; then this + will be BUFFER_FULL. If file pointer gets advanced, then the + protocol will tell the sender to go ahead, and the read_block_reason + will be NO_DATA until the first data arrives. + */ + RBR_BUFFER_FULL, + + /* These conditions are generally only meaningful for nonseekable + objects. */ + } + read_block_reason; /* identifies what holds up reading */ int seekable; /* the file pointer can be reduced */ @@ -62,19 +82,46 @@ struct shared_io off_t wr_file_pointer; off_t xx_file_pointer; - - /* These are set by the user only: */ + off_t file_size; /* These two indicate that the appropriate times need updated */ int written; int accessed; - - /* Reserved for future extensions */ - int reserved [32]; - /* Owned by the user from here to the end of the page */ - int user_owned[0]; + /* File structuring: */ + + /* If the file is not seekable and read data is separate from write + data, then the read data might be structured. Each record is + identified by one of these structures. The "auxil" field + contains extra data which might be of interest to some readers, + but is not part of the data proper (for example, UDP and raw IP + put the internet headers there). + + The IO server guarantees that these will be consecutive, and that + the file_pointer_start of each record will be that of the last + plus its data_length. The last valid structure might grow + whenever the server is it. All previous records from the + rd_file_pointer to the current read_size/file_size will not + change. Records before that can be dropped and the valid records + moved forward in the array (when the server is it); if this + happens indexes_changed will be set to the number of records + dropped. */ + + int indexes_changed; /* users can clear this when they want */ + + /* Users should not modify the rest of this: */ + int use_structure; /* structure is being used */ + struct iomap_structure + { + int file_pointer_start; /* file pointer offset of data */ + int object_start; /* offset of auxil in memory object */ + int auxil_length; /* length of auxil data */ + int data_length; /* length of real data */ + } structure[0]; }; +/* Look at this value to determine the byte order the server is using, + and then use it. */ +#define SHARED_PAGE_MAGIC 0xaabbccdd |